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