小编典典

在Flutter中将Blob显示为图像

flutter

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


阅读 1069

收藏
2020-08-13

共1个答案

小编典典

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

从JSON抓取Blob:

var blob = yourJSONMapHere['yourJSONKeyHere'];

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

现在,使用 图像Image.memory

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

这对我有用!

2020-08-13