FadeInImage constructor

const FadeInImage({
  1. Key? key,
  2. required ImageProvider<Object> placeholder,
  3. ImageErrorWidgetBuilder? placeholderErrorBuilder,
  4. required ImageProvider<Object> 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. Color? color,
  13. BlendMode? colorBlendMode,
  14. Color? placeholderColor,
  15. BlendMode? placeholderColorBlendMode,
  16. double? width,
  17. double? height,
  18. BoxFit? fit,
  19. BoxFit? placeholderFit,
  20. FilterQuality filterQuality = FilterQuality.medium,
  21. FilterQuality? placeholderFilterQuality,
  22. AlignmentGeometry alignment = Alignment.center,
  23. ImageRepeat repeat = ImageRepeat.noRepeat,
  24. 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 and image may have their own BoxFit settings via fit and placeholderFit.

The placeholder and image may have their own FilterQuality settings via filterQuality and placeholderFilterQuality.

If excludeFromSemantics is true, then imageSemanticLabel will be ignored.

Implementation

const FadeInImage({
  super.key,
  required this.placeholder,
  this.placeholderErrorBuilder,
  required this.image,
  this.imageErrorBuilder,
  this.excludeFromSemantics = false,
  this.imageSemanticLabel,
  this.fadeOutDuration = const Duration(milliseconds: 300),
  this.fadeOutCurve = Curves.easeOut,
  this.fadeInDuration = const Duration(milliseconds: 700),
  this.fadeInCurve = Curves.easeIn,
  this.color,
  this.colorBlendMode,
  this.placeholderColor,
  this.placeholderColorBlendMode,
  this.width,
  this.height,
  this.fit,
  this.placeholderFit,
  this.filterQuality = FilterQuality.medium,
  this.placeholderFilterQuality,
  this.alignment = Alignment.center,
  this.repeat = ImageRepeat.noRepeat,
  this.matchTextDirection = false,
});