ImageWidget.network constructor

ImageWidget.network(
  1. String? src, {
  2. Key? key,
  3. required double width,
  4. required double height,
  5. double scale = 1.0,
  6. Widget? errorWidget,
  7. BoxFit fit = BoxFit.none,
  8. Widget? loadingWidget,
  9. ImageFrameBuilder? frameBuilder,
  10. ImageLoadingBuilder? loadingBuilder,
  11. ImageErrorWidgetBuilder? errorBuilder,
  12. String? semanticLabel,
  13. bool excludeFromSemantics = false,
  14. Color? color,
  15. Animation<double>? opacity,
  16. BlendMode? colorBlendMode,
  17. AlignmentGeometry alignment = Alignment.center,
  18. ImageRepeat repeat = ImageRepeat.noRepeat,
  19. Rect? centerSlice,
  20. bool matchTextDirection = false,
  21. bool gaplessPlayback = false,
  22. FilterQuality filterQuality = FilterQuality.low,
  23. bool isAntiAlias = false,
  24. Map<String, String>? headers,
  25. int? cacheWidth,
  26. String? assetUrl,
  27. 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);