AdvancedNetworkImage class

Fetches the given URL from the network, associating it with some options.

Inheritance

Constructors

AdvancedNetworkImage(String url, {double scale = 1.0, int? width, int? height, Map<String, String>? header, bool useDiskCache = false, int retryLimit = 5, Duration retryDuration = const Duration(milliseconds: 500), double retryDurationFactor = 1.5, Duration timeoutDuration = const Duration(seconds: 5), VoidCallback? loadedCallback, VoidCallback? loadFailedCallback, VoidCallback? loadedFromDiskCacheCallback, String? fallbackAssetImage, Uint8List? fallbackImage, CacheRule? cacheRule, LoadingProgress? loadingProgress, UrlResolver? getRealUrl, _ImageProcessing? preProcessing, _ImageProcessing? postProcessing, bool printError = false, List<int>? skipRetryStatusCode, String? id})

Properties

cacheRule CacheRule?
Disk cache rules for advanced control.
final
fallbackAssetImage String?
Displays image from an asset bundle when the image failed to load.
final
fallbackImage Uint8List?
The image will be displayed when the image failed to load and fallbackAssetImage is null.
final
getRealUrl → UrlResolver?
Extract the real url before fetching.
final
hashCode int
The hash code for this object.
no setteroverride
The HTTP headers that will be used with http to fetch image from network.
final
height int?
The height the image should decode to and cache in momory.
final
id String?
final
loadedCallback VoidCallback?
The callback will fire when the image loaded.
final
loadedFromDiskCacheCallback VoidCallback?
The callback will fire when the image loaded from DiskCache.
final
loadFailedCallback VoidCallback?
The callback will fire when the image failed to load.
final
loadingProgress ↔ LoadingProgress?
Report loading progress and data when fetching image.
getter/setter pair
postProcessing → _ImageProcessing?
Receive the data(Uint8List) and do some manipulations after saving.
final
preProcessing → _ImageProcessing?
Receive the data(Uint8List) and do some manipulations before saving.
final
printError bool
Print error messages.
final
retryDuration Duration
The retry duration will give the interval between the retries.
final
retryDurationFactor double
Apply factor to control retry duration between retry.
final
retryLimit int
The retry limit will be used to limit the retry attempts.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scale double
The scale to place in the ImageInfo object of the image.
final
skipRetryStatusCode List<int>?
The HttpStatus code that you can skip retrying if you meet them.
final
timeoutDuration Duration
The timeout duration will give the timeout to a fetching function.
final
url String
The URL from which the image will be fetched.
final
useDiskCache bool
The flag control the disk cache will be used or not.
final
width int?
The width the image should decode to and cache in memory.
final

Methods

createStream(ImageConfiguration configuration) ImageStream
Called by resolve to create the ImageStream it returns.
inherited
evict({ImageCache? cache, ImageConfiguration configuration = ImageConfiguration.empty, bool memory = true, bool disk = false}) Future<bool>
Evicts an entry from the image cache.
override
load(AdvancedNetworkImage key, dynamic decode) ImageStreamCompleter
loadBuffer(AdvancedNetworkImage key, DecoderBufferCallback decode) ImageStreamCompleter
Converts a key into an ImageStreamCompleter, and begins fetching the image.
inherited
loadFromDiskCache() Future<Uint8List?>
Load the disk cache
loadImage(AdvancedNetworkImage key, ImageDecoderCallback decode) ImageStreamCompleter
Converts a key into an ImageStreamCompleter, and begins fetching the image.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
obtainCacheStatus({required ImageConfiguration configuration, ImageErrorListener? handleError}) Future<ImageCacheStatus?>
Returns the cache location for the key that this ImageProvider creates.
inherited
obtainKey(ImageConfiguration configuration) Future<AdvancedNetworkImage>
Converts an ImageProvider's settings plus an ImageConfiguration to a key that describes the precise image to load.
override
resolve(ImageConfiguration configuration) ImageStream
Resolves this image provider using the given configuration, returning an ImageStream.
inherited
resolveStreamForKey(ImageConfiguration configuration, ImageStream stream, AdvancedNetworkImage key, ImageErrorListener handleError) → void
Called by resolve with the key returned by obtainKey.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(dynamic other) bool
The equality operator.
override