【问题标题】:Exception caught by widgets library. (Assertion failed)小部件库捕获的异常。 (断言失败)
【发布时间】:2021-11-07 10:44:41
【问题描述】:

在运行我的 Flutter 代码时,我遇到了以下错误:

**-------------------------------Starts Here-----------------------------------**

-------------------Exception caught by widgets library-----------------------

The following assertion was thrown building *CryptoListItem*(dirty)

Assertion failed:

assetName != null

is not true

**--------------------------------Ends Here------------------------------------**

这是错误的快照: VS 调试控制台中的错误 sn-p:

请帮我解决这个问题,因为我的项目被卡住了。

【问题讨论】:

    标签: flutter dart flutter-widget flutter-android


    【解决方案1】:

    为assetName设置一个值,因为目前它为空

    【讨论】:

    • 谢谢!发生错误是因为它确实为空。实际上,我正在从 API 中检索图像 URL,但 API 突然在版本更新中更改了 URL,而我并不知道。
    • 很高兴它有帮助。请接受答案并点赞
    猜你喜欢
    • 1970-01-01
    • 2021-01-17
    • 2019-06-13
    • 2020-08-18
    • 1970-01-01
    • 2023-03-29
    • 2011-09-16
    • 1970-01-01
    相关资源
    最近更新 更多