CustomImage.network constructor

CustomImage.network(
  1. String url, {
  2. Key? key,
  3. Size? size,
  4. BoxFit? fit,
  5. double? width,
  6. double? height,
  7. BoxShape? shape,
  8. double? scaleByWidth,
  9. double? scaleByHeight,
  10. Color? color,
  11. GestureTapCallback? onTap,
  12. Curve? curve,
  13. EdgeInsetsGeometry? margin,
  14. EdgeInsetsGeometry? padding,
  15. Animation<double>? opacity,
  16. int? maxWidth,
  17. int? maxHeight,
  18. String? cacheKey,
  19. Rect? centerSlice,
  20. GestureLongPressCallback? onLongPress,
  21. ImageFrameBuilder? frameBuilder,
  22. ImageErrorWidgetBuilder? errorBuilder,
  23. BorderRadius? borderRadius,
  24. double scale = 1.0,
  25. String? semanticLabel,
  26. BlendMode? colorBlendMode,
  27. ImageLoadingBuilder? loadingBuilder,
  28. Color? backgroundColor,
  29. Duration? animationDuration,
  30. bool isAntiAlias = false,
  31. Map<String, String>? headers,
  32. bool gaplessPlayback = false,
  33. BaseCacheManager? cacheManager,
  34. bool matchTextDirection = false,
  35. bool excludeFromSemantics = false,
  36. AlignmentGeometry alignment = Alignment.center,
  37. ImageRepeat repeat = ImageRepeat.noRepeat,
  38. void errorListener(
    1. Object
    )?,
  39. FilterQuality filterQuality = FilterQuality.medium,
})

Implementation

CustomImage.network(
  String url, {
  super.key,
  Size? size,
  BoxFit? fit,
  double? width,
  double? height,
  BoxShape? shape,
  double? scaleByWidth, // 固定宽度等比缩放
  double? scaleByHeight, // 固定高度等比缩放
  this.color,
  this.onTap,
  this.curve,
  this.margin,
  this.padding,
  this.opacity,
  int? maxWidth,
  int? maxHeight,
  String? cacheKey,
  this.centerSlice,
  this.onLongPress,
  this.frameBuilder,
  this.errorBuilder,
  this.borderRadius,
  double scale = 1.0,
  this.semanticLabel,
  this.colorBlendMode,
  this.loadingBuilder,
  this.backgroundColor,
  this.animationDuration,
  this.isAntiAlias = false,
  Map<String, String>? headers,
  this.gaplessPlayback = false,
  BaseCacheManager? cacheManager,
  this.matchTextDirection = false,
  this.excludeFromSemantics = false,
  this.alignment = Alignment.center,
  this.repeat = ImageRepeat.noRepeat,
  void Function(Object)? errorListener,
  this.filterQuality = FilterQuality.medium,
})  : _image = CachedNetworkImageProvider(
        url,
        scale: scale,
        headers: headers,
        cacheKey: cacheKey,
        maxWidth: maxWidth,
        maxHeight: maxHeight,
        cacheManager: cacheManager,
        errorListener: errorListener,
      ),
      width = _computeScaleWidth(
          scaleByWidth, scaleByHeight, width, height, size),
      height = _computeScaleHeight(
          scaleByWidth, scaleByHeight, width, height, size),
      fit = _handleFit(fit, scaleByWidth, scaleByHeight),
      shape = _handleShape(shape, scaleByWidth, scaleByHeight);