ImageExt constructor

const ImageExt({
  1. Key? key,
  2. required ImageProvider<Object> image,
  3. CustomImageBuilder? imageBuilder,
  4. ImageFrameBuilder? frameBuilder,
  5. ImageLoadingBuilder? loadingBuilder,
  6. ImageErrorWidgetBuilder? errorBuilder,
  7. String? semanticLabel,
  8. bool excludeFromSemantics = false,
  9. double? width,
  10. double? height,
  11. Color? color,
  12. Animation<double>? opacity,
  13. BlendMode? colorBlendMode,
  14. BoxFit? fit,
  15. AlignmentGeometry alignment = Alignment.center,
  16. ImageRepeat repeat = ImageRepeat.noRepeat,
  17. Rect? centerSlice,
  18. bool matchTextDirection = false,
  19. bool gaplessPlayback = false,
  20. bool isAntiAlias = false,
  21. bool scrollAwareEnable = false,
  22. FilterQuality filterQuality = FilterQuality.low,
})

Creates a widget that displays an image.

To show an image from the network or from an asset bundle, consider using new Image.network and new Image.asset respectively.

The image, alignment, repeat, and matchTextDirection arguments must not be null.

Either the width and height arguments should be specified, or the widget should be placed in a context that sets tight layout constraints. Otherwise, the image dimensions will change as the image is loaded, which will result in ugly layout changes.

Use filterQuality to specify the rendering quality of the image.

If excludeFromSemantics is true, then semanticLabel will be ignored.

Implementation

const ImageExt({
  Key? key,
  required this.image,
  this.imageBuilder,
  this.frameBuilder,
  this.loadingBuilder,
  this.errorBuilder,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.width,
  this.height,
  this.color,
  this.opacity,
  this.colorBlendMode,
  this.fit,
  this.alignment = Alignment.center,
  this.repeat = ImageRepeat.noRepeat,
  this.centerSlice,
  this.matchTextDirection = false,
  this.gaplessPlayback = false,
  this.isAntiAlias = false,
  this.scrollAwareEnable = false,
  this.filterQuality = FilterQuality.low,
}) : assert(image != null),
      assert(alignment != null),
      assert(repeat != null),
      assert(filterQuality != null),
      assert(matchTextDirection != null),
      assert(isAntiAlias != null),
      super(key: key);