断言失败:url!= null不正确

编程入门 行业动态 更新时间:2024-10-10 12:17:46
本文介绍了断言失败:url!= null不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

════════小部件库捕获到异常═══════════════════════════════════在构建HomePage(dirty,state:_HomePageState#493d9)时引发了以下断言:断言失败:F:\…\ painting_network_image_web.dart:23url!= null是不正确的

════════ Exception caught by widgets library ═══════════════════════════════════ The following assertion was thrown building HomePage(dirty, state: _HomePageState#493d9): Assertion failed: F:\…\painting_network_image_web.dart:23 url != null is not true

这是我在home.dart中添加此代码时遇到的错误

This is the error I get when I add this codes in home.dart

WallpaperModel wallpaperModel = WallpaperModel(); wallpaperModel = WallpaperModel.fromMap(element); wallpapers.add(wallpaperModel);

/widget/widget.dart

also /widget/widget.dart

Widget wallpapersList({List<WallpaperModel> wallpapers, context}) { return Container( padding: EdgeInsets.symmetric(horizontal: 15.0), child: GridView.count( shrinkWrap: true, physics: ClampingScrollPhysics(), crossAxisCount: 2, childAspectRatio: 1.0, mainAxisSpacing: 5.0, crossAxisSpacing: 5.0, children: wallpapers.map((wallpaper) { return GridTile( child: Container( child: Imagework(wallpaper.src.portrait), ), ); }).toList(), ), ); }

这是我执行代码时遇到的错误我尝试使用 flutter清理,然后再运行 flutter run -v

this is the error I get when I execute my code I tried to use flutter clean also then run flutter run -v

推荐答案

看到代码后,请更改

return SrcModel( orignal: jsonData["orignal"], small: jsonData["small"], portrait: jsonData["protrait"], );

return SrcModel( orignal: jsonData["original"], small: jsonData["small"], portrait: jsonData["portrait"], );

现在我看到了你的照片,我喜欢你的设计

now I see your pics and I like your design

更多推荐

断言失败:url!= null不正确

本文发布于:2023-11-02 07:17:11,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1551724.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:断言   不正确   url   null

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!