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.
Asked
Active
Viewed 845 times
0

dina robert
- 241
- 3
- 10
1 Answers
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
-
1It gave me an error : Invalid character (at character 5) in the blobpath – dina robert May 30 '22 at 21:05
-
The answer is edited by @amateurCoder and should work now – DEFL May 31 '22 at 13:40