Image constructor

const Image({Key key, @required ImageProvider image, String semanticLabel, bool excludeFromSemantics: false, double width, double height, Color color, BlendMode colorBlendMode, BoxFit fit, AlignmentGeometry alignment:, ImageRepeat repeat: ImageRepeat.noRepeat, Rect centerSlice, bool matchTextDirection: false, bool gaplessPlayback: false })

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.

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,
}) : assert(image != null),
     assert(alignment != null),
     assert(repeat != null),
     assert(matchTextDirection != null),
     super(key: key);