imagedartblobflutter

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!


Solution

  • If anyone is interested, I found the solution: grab the blob from JSON and use it as an argument to Image.memory():

    var blob = yourJSONMapHere['yourJSONKeyHere'];
    var image = BASE64.decode(blob); // image is a Uint8List
    new Container(child: new Image.memory(image));