FadeInImage.memoryNetwork constructor
Creates a widget that uses a placeholder image stored in memory while loading the final image from the network.
placeholder
contains the bytes of the in-memory image.
image
is the URL of the final image.
placeholderScale
and imageScale
are passed to their respective
ImageProviders (see also ImageInfo.scale).
The placeholder
, image
, placeholderScale
, imageScale
,
fadeOutDuration
, fadeOutCurve
, fadeInDuration
, fadeInCurve
,
alignment
, repeat
, and matchTextDirection
arguments must not be
null.
See also:
- new Image.memory, which has more details about loading images from memory.
- new Image.network, which has more details about loading images from the network.
Implementation
FadeInImage.memoryNetwork({
Key key,
@required Uint8List placeholder,
@required String image,
double placeholderScale = 1.0,
double imageScale = 1.0,
this.fadeOutDuration = const Duration(milliseconds: 300),
this.fadeOutCurve = Curves.easeOut,
this.fadeInDuration = const Duration(milliseconds: 700),
this.fadeInCurve = Curves.easeIn,
this.width,
this.height,
this.fit,
this.alignment = Alignment.center,
this.repeat = ImageRepeat.noRepeat,
this.matchTextDirection = false,
}) : assert(placeholder != null),
assert(image != null),
assert(placeholderScale != null),
assert(imageScale != null),
assert(fadeOutDuration != null),
assert(fadeOutCurve != null),
assert(fadeInDuration != null),
assert(fadeInCurve != null),
assert(alignment != null),
assert(repeat != null),
assert(matchTextDirection != null),
placeholder = MemoryImage(placeholder, scale: placeholderScale),
image = NetworkImage(image, scale: imageScale),
super(key: key);