【发布时间】:2020-09-19 20:57:53
【问题描述】:
════════小部件库捕获的异常═════════════════════════════════════ ═ 在构建 HomePage(dirty, state: _HomePageState#493d9) 时抛出了以下断言: 断言失败: F:\...\painting_network_image_web.dart:23 网址!= null 不是真的
这是我在 home.dart 中添加此代码时遇到的错误
WallpaperModel wallpaperModel = WallpaperModel();
wallpaperModel = WallpaperModel.fromMap(element);
wallpapers.add(wallpaperModel);
还有 /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: Image.network(wallpaper.src.portrait), ), ); }).toList(), ), ); }
这是我在执行code 时遇到的错误,我尝试使用flutter clean 然后运行flutter run -v
【问题讨论】: