Image constructor
- Key? key,
- required ImageProvider<
Object> image, - ImageFrameBuilder? frameBuilder,
- ImageLoadingBuilder? loadingBuilder,
- ImageErrorWidgetBuilder? errorBuilder,
- String? semanticLabel,
- bool excludeFromSemantics = false,
- double? width,
- double? height,
- Color? color,
- Animation<
double> ? opacity, - BlendMode? colorBlendMode,
- BoxFit? fit,
- AlignmentGeometry alignment = Alignment.center,
- ImageRepeat repeat = ImageRepeat.noRepeat,
- Rect? centerSlice,
- bool matchTextDirection = false,
- bool gaplessPlayback = false,
- bool isAntiAlias = false,
- FilterQuality filterQuality = FilterQuality.medium,
Creates a widget that displays an image.
To show an image from the network or from an asset bundle, consider using Image.network and Image.asset respectively.
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 Image({
super.key,
required this.image,
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.filterQuality = FilterQuality.medium,
});