Creates a widget that displays an ImageStream obtained from an asset
bundle. The key for the image is given by the name
argument.
If the bundle
argument is omitted or null, then the
DefaultAssetBundle will be used.
If the scale
argument is omitted or null, then pixel-density-aware asset
resolution will be attempted.
If width and height are both specified, and scale
is not, then
size-aware asset resolution will be attempted also.
The name
and repeat arguments must not be null.
Source
Image.asset(String name, { Key key, AssetBundle bundle, double scale, this.width, this.height, this.color, this.fit, this.alignment, this.repeat: ImageRepeat.noRepeat, this.centerSlice, this.gaplessPlayback: false }) : image = scale != null ? new ExactAssetImage(name, bundle: bundle, scale: scale) : new AssetImage(name, bundle: bundle), super(key: key);