【问题标题】:App crashing when image url failed in flutter当图像 url 在颤动中失败时应用程序崩溃
【发布时间】:2020-03-16 22:50:40
【问题描述】:
Exception caught by package:flutter_image ═════════════════════════════════════════════════
The following FetchFailure was thrown NetworkImageWithRetry failed to load http://204.11.59.195/~automobi/aiswariaooh/uploads/images/1573712028.jpg:
FetchFailure(
  attemptCount: 1
  httpStatusCode: 404
  totalDuration: 0:00:01.143462
  originalException: null
)

我尝试了stackoverflow中提供的解决方案,但我的问题没有解决

Image(  image: NetworkImageWithRetry(img1),
        height: imageHeight, 
        ),

【问题讨论】:

    标签: flutter flutter-image


    【解决方案1】:
    Use this package : (https://pub.dev/packages/cached_network_image)!: 
    
    CachedNetworkImage(
            imageUrl: "http://via.placeholder.com/350x150",
            placeholder: (context, url) => CircularProgressIndicator(),
            errorWidget: (context, url, error) => Icon(Icons.error),
         ),
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-25
      • 2022-12-19
      • 1970-01-01
      • 2022-07-31
      • 1970-01-01
      • 2018-03-26
      相关资源
      最近更新 更多