use*_*047 5 image exception dart flutter
能否帮忙解决当图像不存在或图像返回码时如何捕获异常HTTP request failed, statusCode: 403
dynamic _getImage() {
try {
return Image.network(
"https://cdn.dribbble.com/users/1343501/screenshots/4789104/box_800_-601_2.gif",
height: 96.0,
width: 96.0,
fit: BoxFit.cover);
} catch (e) {
return Icon(Icons.print);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
11342 次 |
| 最近记录: |