在Flutter中将Blob显示为图像


问题内容

有谁知道如何使用Flutter将Blob转换为图像?看起来该'dart:html'库在Flutter中不可用。任何帮助表示赞赏。谢谢!


问题答案:

如果有人感兴趣,我找到了解决方案:

从JSON抓取Blob:

var blob = yourJSONMapHere['yourJSONKeyHere'];

var image = BASE64.decode(blob); //图片是一个Uint8List

现在,使用 图像Image.memory

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

这对我有用!