FadeInImage constructor

const FadeInImage({Key key, @required ImageProvider placeholder, @required ImageProvider image, bool excludeFromSemantics: false, String imageSemanticLabel, String placeholderSemanticLabel, Duration fadeOutDuration: const Duration(milliseconds: 300), Curve fadeOutCurve: Curves.easeOut, Duration fadeInDuration: const Duration(milliseconds: 700), Curve fadeInCurve: Curves.easeIn, double width, double height, BoxFit fit, AlignmentGeometry alignment: Alignment.center, ImageRepeat repeat: ImageRepeat.noRepeat, bool matchTextDirection: false })

Creates a widget that displays a placeholder while an image is loading then cross-fades to display the image.

The placeholder, image, fadeOutDuration, fadeOutCurve, fadeInDuration, fadeInCurve, alignment, repeat, and matchTextDirection arguments must not be null.

There are two different semantic label for the class. placeholderSemanticLabel is used for defining a semantics label for placeholder. imageSemanticLabel is used for defining a semantics label for image

If excludeFromSemantics is true, then placeholderSemanticLabel and imageSemanticLabel will be ignored.

Implementation

const FadeInImage({
  Key key,
  @required this.placeholder,
  @required this.image,
  this.excludeFromSemantics = false,
  this.imageSemanticLabel,
  this.placeholderSemanticLabel,
  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(fadeOutDuration != null),
     assert(fadeOutCurve != null),
     assert(fadeInDuration != null),
     assert(fadeInCurve != null),
     assert(alignment != null),
     assert(repeat != null),
     assert(matchTextDirection != null),
     super(key: key);