我正在使用 Navigator 的声明式方法:
Navigator(
pages: [
MaterialPage(child: _screen),
],
onPopPage: (route, result) {
return route.didPop(result);
},
);
Run Code Online (Sandbox Code Playgroud)
如何在屏幕之间添加过渡?
我使用 Image.network() 显示来自 URL 的图像,这就是我使用它的方式
Image image = Image.network(
_auth.currentUser!.photoURL!,
width: 100.getWidth(context),
height: 100.getWidth(context),
frameBuilder: (context, child, frame, wasSynchronouslyLoaded) {
return wasSynchronouslyLoaded
? child
: _profileImagePlaceholder(context);
},
loadingBuilder: (context, child, loadingProgress) {
return loadingProgress == null
? child
: _profileImagePlaceholder(context);
},
errorBuilder: (context, error, stackTrace) {
return _profileImagePlaceholder(context);
},
);
Run Code Online (Sandbox Code Playgroud)
但即使当我设置 errorBuilder 甚至用 try/catch 包装整个事情时这NetworkImageLoadException仍然显示
完全例外
The following NetworkImageLoadException was thrown resolving an image codec:
HTTP request failed, statusCode: 403,
When the exception was thrown, this was the …Run Code Online (Sandbox Code Playgroud)