0

I'm working on a flutter project and I have this blob URL : blob:http://localhost:8401/5b85ac22-079a-410a-a05b-02fe09bda14a which contain an image and I want to display it in my flutter project using Image.asset("blob:http://localhost:8401/5b85ac22-079a-410a-a05b-02fe09bda14a") but it gave me this error urlopen error unknown url type: blob. Is there a way to display a blob image. Any help is highly appreciated.

dina robert
  • 241
  • 3
  • 10

1 Answers1

0

Grab the blob from the URL:

var blobPath = "http://localhost:8401/5b85ac22-079a-410a-a05b-02fe09bda14a";

Then use BASE64 for decoding. It returns a Unit8List see https://api.flutter.dev/flutter/dart-convert/base64Decode.html

Uint8List image = base64.decode(blobPath); 

For Displaying you can use Image.memory

Image.memory(image);
AmateurCoder
  • 153
  • 10
DEFL
  • 907
  • 7
  • 20