Flutter系列(1):解决flutter中web端 The following ProgressEvent$ object was thrown resolving an image codec

在flutter中使用图片组件image,在终端选择为web时,会报错,具体报错信息如下:
Flutter系列(1):解决flutter中web端 The following ProgressEvent$ object was thrown resolving an image codec_第1张图片
具体解决办法有以下两种:
一、命令行依次输入

1、flutter build web --release --web-renderer html
2、flutter run --web-renderer html

选择,要运行的终端:
Flutter系列(1):解决flutter中web端 The following ProgressEvent$ object was thrown resolving an image codec_第2张图片
二、直接运行以下命令:

不指定终端
flutter run  --web-renderer html --release
指定终端运行
flutter run -d edge --web-renderer html --release

图片即可成功显示!

你可能感兴趣的:(Flutter,flutter)