图像不是imageprovider动态类型的子类型

时间:2019-11-30 14:20:52

标签: android ios flutter dart runtime-error

当我从图像选择器中选择图像时,我得到此错误类型文件不是“动态图像提供程序”类型的子类型 我已经尝试了所有方法,但无法使其正常工作……帮我,我不知道该怎么办。

1 个答案:

答案 0 :(得分:0)

您必须使用Image.file()构造函数。

return Image.file(
// _image has to be a File object. The one that you get when you use ImagePicker
_image
);