FadeInImage constructor

const FadeInImage(
  1. {Key key,
  2. @required ImageProvider placeholder,
  3. ImageErrorWidgetBuilder placeholderErrorBuilder,
  4. @required ImageProvider image,
  5. ImageErrorWidgetBuilder imageErrorBuilder,
  6. bool excludeFromSemantics: false,
  7. String imageSemanticLabel,
  8. Duration fadeOutDuration: const Duration(milliseconds: 300),
  9. Curve fadeOutCurve: Curves.easeOut,
  10. Duration fadeInDuration: const Duration(milliseconds: 700),
  11. Curve fadeInCurve: Curves.easeIn,
  12. double width,
  13. double height,
  14. BoxFit fit,
  15. AlignmentGeometry alignment: Alignment.center,
  16. ImageRepeat repeat: ImageRepeat.noRepeat,
  17. bool matchTextDirection: false}

Creates a widget that displays a placeholder while an image is loading, then fades-out the placeholder and fades-in the image.

The placeholder and image may be composed in a ResizeImage to provide a custom decode/cache size.

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

If excludeFromSemantics is true, then imageSemanticLabel will be ignored.


const FadeInImage({
  Key key,
  @required this.placeholder,
  @required this.image,
  this.excludeFromSemantics = false,
  this.fadeOutDuration = const Duration(milliseconds: 300),
  this.fadeOutCurve = Curves.easeOut,
  this.fadeInDuration = const Duration(milliseconds: 700),
  this.fadeInCurve = Curves.easeIn,
  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);