Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display Blob as Image in Flutter

Does anyone know how to convert a Blob into an image with Flutter? It looks like the 'dart:html' library is not available in Flutter. Any help is appreciated. Thank you!

like image 640
Kyle Stokes Avatar asked Aug 07 '17 14:08

Kyle Stokes


1 Answers

If anyone is interested, I found the solution:

Grab the blob from JSON:

var blob = yourJSONMapHere['yourJSONKeyHere'];

var image = BASE64.decode(blob); // image is a Uint8List

Now, use image in a Image.memory

new Container( child: new Image.memory(image));

This worked for me!

like image 53
Kyle Stokes Avatar answered Nov 11 '22 18:11

Kyle Stokes