Image constructor

const Image(
  1. {Key key,
  2. @required ImageProvider image,
  3. ImageFrameBuilder frameBuilder,
  4. ImageLoadingBuilder loadingBuilder,
  5. String semanticLabel,
  6. bool excludeFromSemantics: false,
  7. double width,
  8. double height,
  9. Color color,
  10. BlendMode colorBlendMode,
  11. BoxFit fit,
  12. AlignmentGeometry alignment:,
  13. ImageRepeat repeat: ImageRepeat.noRepeat,
  14. Rect centerSlice,
  15. bool matchTextDirection: false,
  16. bool gaplessPlayback: false,
  17. 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 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 change the quality when scaling an image. Use the FilterQuality.low quality setting to scale the image, which corresponds to bilinear interpolation, rather than the default FilterQuality.none which corresponds to nearest-neighbor.

If excludeFromSemantics is true, then semanticLabel will be ignored.


const Image({
  Key key,
  @required this.image,
  this.excludeFromSemantics = false,
  this.alignment =,
  this.repeat = ImageRepeat.noRepeat,
  this.matchTextDirection = false,
  this.gaplessPlayback = false,
  this.filterQuality = FilterQuality.low,
}) : assert(image != null),
     assert(alignment != null),
     assert(repeat != null),
     assert(filterQuality != null),
     assert(matchTextDirection != null),
     super(key: key);