Flutter 资源未通过 Dart 3 加载到 Web 版本中

Anm*_*ngh 7 dart flutter

我正在使用一个在 android 中正常工作的资产图像,但它在网络中给出以下错误 -\n“解析图像时抛出以下 FormatException:消息已损坏”

\n

当 IDM(互联网下载管理器)拦截 AndroidManifest.bin 时会出现此问题

\n

在此输入图像描述

\n
\xe2\x80\xa2 Flutter 3.10.0\n\xe2\x80\xa2 channel stable\n\xe2\x80\xa2 2023-05-09 07:41:44 -0700\n\xe2\x80\xa2 Dart 3.0.0\n
Run Code Online (Sandbox Code Playgroud)\n

Anm*_*ngh 9

一种临时解决方案是将您的浏览器从 IDM 捕获列表中删除。

这可以在 IDM 中通过下载 -> 选项 -> 常规来完成。

您可以关注以下更新: https ://github.com/flutter/flutter/issues/124883


小智 0

首先非常感谢您提供完整的信息,例如flutter doctor

我之前也遇到过同样的问题,你应该有网络和Android的条件,尝试一下网络,如果它有效,请输入你的条件:

Image.asset(
        'images/my_image.png', // replace with the actual path and name of your image file
        fit: BoxFit.cover,
      ),
Run Code Online (Sandbox Code Playgroud)

让我知道我可以帮助你。

快乐编码...