════════小部件库捕获到异常═══════════════════════════════════在构建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不正确
发布评论