flutter_network_image 0.2.0
flutter_network_image: ^0.2.0 copied to clipboard
flutter package that provides an ImageProvider automatically retries failed network image loads, ensuring smooth image loading on mobile and web platforms.
0.2.0 #
Breaking changes #
- Minimum SDK raised to Dart 3.0 / Flutter 3.10 (required by
ImageProvider.loadImage). - Failed loads are now retried by default (3 attempts, no retry on permanent HTTP 4xx errors other than 408/429). Pass
retryWhen: nullto keep the old no-retry behavior. NetworkImageProviderequality andhashCodenow includeheaders,maxWidthandmaxHeight, so providers differing in those are no longer treated as the same image by Flutter's image cache.- When the cache manager returns no file, the client throws
NetworkImageEmptyResponseExceptioninstead of a fake 404NetworkImageLoadException.
Added #
NetworkImageClient(cacheManager: ...)to customise disk caching (stale period, max objects, directory).BaseNetworkImageClientandNetworkImageClientare now exported, so custom clients can be written.Attempt.errorandAttempt.stackTrace, soretryWhencan decide per error.retryDelayandNetworkImageRetry.exponentialBackoff()(capped, optional jitter);retryAfterstill works as a fixed delay.NetworkImageRetrywithdefaultWhen,isPermanentErrorandexponentialBackoff()helpers.NetworkImageProvider.evictFromDisk(),BaseNetworkImageClient.evict()andclearCache().
Fixed #
- Retries threw "Cannot add event after closing" because the progress stream was closed before the retry ran.
- Download progress events are no longer added to a closed stream.
0.1.0 #
- Update network client
0.0.8 #
- Fix attempt counter
0.0.7+1 #
- Fix typo
0.0.7 #
- Adds documentation
- Update Example
0.0.6+1 #
- Update README
0.0.6 #
- Update README
0.0.5 #
- Adds attempt data
- Update example
0.0.4 #
- Load image using flutter cache manager
0.0.3 #
- Update retryWhen callback
0.0.2+1 #
- Documentation
0.0.2 #
- LoadingBuilder image
0.0.1 #
- Initial release