Image.network constructor

Image.network(String src, { Key key, double scale: 1.0, double width, double height, Color color, BlendMode colorBlendMode, BoxFit fit, AlignmentGeometry alignment: Alignment.center, ImageRepeat repeat: ImageRepeat.noRepeat, Rect centerSlice, bool matchTextDirection: false, bool gaplessPlayback: false, Map<String, String> headers })

Creates a widget that displays an ImageStream obtained from the network.

The src, scale, and repeat 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.

All network images are cached regardless of HTTP headers.

An optional headers argument can be used to send custom HTTP headers with the image request.

Implementation

Image.network(String src, {
  Key key,
  double scale: 1.0,
  this.width,
  this.height,
  this.color,
  this.colorBlendMode,
  this.fit,
  this.alignment: Alignment.center,
  this.repeat: ImageRepeat.noRepeat,
  this.centerSlice,
  this.matchTextDirection: false,
  this.gaplessPlayback: false,
  Map<String, String> headers,
}) : image = new NetworkImage(src, scale: scale, headers: headers),
     assert(alignment != null),
     assert(repeat != null),
     assert(matchTextDirection != null),
     super(key: key);