我使用 Flutter camera plugin 生成了一个图像. 我正在尝试展示它。
我的路径如下:
/data/user/0/com.example.myapp/app_flutter/picture2.jpg
我应该如何加载它?
我试过了:
new Image.network("file:///"+imagePath)
但我得到了错误:
Another exception was thrown: Invalid argument(s): No host specified in URI file:////data/user/0/com.example.myapp/app_flutter/picture2.jpg
最佳答案
方法是使用:
new Image.file(File(imagePath))
见 stackoverflow questions
https://stackoverflow.com/questions/50377343/