AdvancedNetworkImage class

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

Warning: If you don't use TransitionToImage, you have to set fallbackAssetImage or fallbackImage to prevent app crashes in release mode.

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 disableMemoryCache: false, bool printError: false, List<int> skipRetryStatusCode})

Properties

cacheRule CacheRule
Disk cache rules for advanced control.
final
disableMemoryCache bool
If set to enable, the image will skip ImageCache. [...]
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. [...]
read-only, override
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
loadedCallback VoidCallback
The callback will fire when the image loaded.
final
loadedFromDiskCacheCallback VoidCallback
The callback will fire when the image loaded from DiskCache.
read / write
loadFailedCallback VoidCallback
The callback will fire when the image failed to load.
final
loadingProgress ↔ LoadingProgress
Report loading progress and data when fetching image.
read / write
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.
read-only, inherited
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. [...]
@protected, inherited
evict({ImageCache cache, ImageConfiguration configuration: ImageConfiguration.empty}) Future<bool>
Evicts an entry from the image cache. [...]
inherited
load(AdvancedNetworkImage key, DecoderCallback decode) ImageStreamCompleter
Converts a key into an ImageStreamCompleter, and begins fetching the image. [...]
override
loadFromDiskCache() Future<Uint8List>
Load the disk cache [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
obtainCacheStatus({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. [...]
override
resolveStreamForKey(ImageConfiguration configuration, ImageStream stream, AdvancedNetworkImage key, ImageErrorListener handleError) → void
Called by resolve with the key returned by obtainKey. [...]
@protected, inherited
toString() String
Returns a string representation of this object.
override

Operators

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