3
 Future<Uint8List> _loadNetworkImage(String imgname) async {
    try {
      final ByteData imageData = await NetworkAssetBundle(Uri.parse('https://picsum.photos/250?image=9')).load("");
      final Uint8List bytes = imageData.buffer.asUint8List();
      return bytes;
    } catch (_) {
      throw "Couldn't resolve network Image.";
    }
  }

when i run this code on flutter web i am getting this error i dont know why can anyone please help me.

Error: Couldn't resolve network Image.

1 Answer 1

1
Uri uri = Uri.parse(filePath);
Uint8List fileData = await http.readBytes(uri);
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.