ImageWidget.asset constructor
ImageWidget.asset(
- String? assetUrl, {
- Key? key,
- AssetBundle? bundle,
- ImageFrameBuilder? frameBuilder,
- ImageErrorWidgetBuilder? errorBuilder,
- String? semanticLabel,
- bool excludeFromSemantics = false,
- double? scale,
- required double width,
- required double height,
- Color? color,
- Animation<
double> ? opacity, - BlendMode? colorBlendMode,
- BoxFit fit = BoxFit.none,
- AlignmentGeometry alignment = Alignment.center,
- ImageRepeat repeat = ImageRepeat.noRepeat,
- Rect? centerSlice,
- bool matchTextDirection = false,
- bool gaplessPlayback = false,
- bool isAntiAlias = false,
- String? package,
- FilterQuality filterQuality = FilterQuality.low,
- int? cacheWidth,
- int? cacheHeight,
- String? src,
- Widget? errorWidget,
- Widget? loadingWidget,
Implementation
ImageWidget.asset(
this.assetUrl, {
Key? key,
AssetBundle? bundle,
this.frameBuilder,
this.errorBuilder,
this.semanticLabel,
this.excludeFromSemantics = false,
double? scale,
required this.width,
required this.height,
this.color,
this.opacity,
this.colorBlendMode,
this.fit = BoxFit.none,
this.alignment = Alignment.center,
this.repeat = ImageRepeat.noRepeat,
this.centerSlice,
this.matchTextDirection = false,
this.gaplessPlayback = false,
this.isAntiAlias = false,
String? package,
this.filterQuality = FilterQuality.low,
this.cacheWidth,
this.cacheHeight,
this.src,
this.errorWidget,
this.loadingWidget,
}) : image = ResizeImage.resizeIfNeeded(
cacheWidth,
cacheHeight,
scale != null
? ExactAssetImage(assetUrl ?? '', bundle: bundle, scale: scale, package: package)
: AssetImage(assetUrl ?? '', bundle: bundle, package: package),
),
loadingBuilder = null,
assert(cacheWidth == null || cacheWidth > 0),
assert(cacheHeight == null || cacheHeight > 0),
super(key: key);