ExtendedImage.network constructor

ExtendedImage.network(
  1. String url, {
  2. Key? key,
  3. String? semanticLabel,
  4. bool excludeFromSemantics = false,
  5. double? width,
  6. double? height,
  7. Color? color,
  8. BlendMode? colorBlendMode,
  9. BoxFit? fit,
  10. Alignment alignment = Alignment.center,
  11. ImageRepeat repeat = ImageRepeat.noRepeat,
  12. Rect? centerSlice,
  13. bool matchTextDirection = false,
  14. bool gaplessPlayback = false,
  15. FilterQuality filterQuality = FilterQuality.low,
  16. LoadStateChanged? loadStateChanged,
  17. BoxShape? shape,
  18. BoxBorder? border,
  19. BorderRadius? borderRadius,
  20. Clip clipBehavior = Clip.antiAlias,
  21. bool enableLoadState = true,
  22. BeforePaintImage? beforePaintImage,
  23. AfterPaintImage? afterPaintImage,
  24. ExtendedImageMode mode = ExtendedImageMode.none,
  25. bool enableMemoryCache = true,
  26. bool clearMemoryCacheIfFailed = true,
  27. DoubleTap? onDoubleTap,
  28. InitGestureConfigHandler? initGestureConfigHandler,
  29. bool enableSlideOutPage = false,
  30. BoxConstraints? constraints,
  31. CancellationToken? cancelToken,
  32. int retries = 3,
  33. Duration? timeLimit,
  34. Map<String, String>? headers,
  35. bool cache = true,
  36. double scale = 1.0,
  37. Duration timeRetry = const Duration(milliseconds: 100),
  38. Key? extendedImageEditorKey,
  39. InitEditorConfigHandler? initEditorConfigHandler,
  40. HeroBuilderForSlidingPage? heroBuilderForSlidingPage,
  41. bool clearMemoryCacheWhenDispose = false,
  42. bool handleLoadingProgress = false,
  43. Key? extendedImageGestureKey,
  44. int? cacheWidth,
  45. int? cacheHeight,
  46. bool isAntiAlias = false,
  47. String? cacheKey,
  48. bool printError = true,
  49. double? compressionRatio,
  50. int? maxBytes,
  51. bool cacheRawData = false,
  52. String? imageCacheName,
  53. Duration? cacheMaxAge,
})

Implementation

ExtendedImage.network(
  String url, {
  Key? key,
  this.semanticLabel,
  this.excludeFromSemantics = false,
  this.width,
  this.height,
  this.color,
  this.colorBlendMode,
  this.fit,
  this.alignment = Alignment.center,
  this.repeat = ImageRepeat.noRepeat,
  this.centerSlice,
  this.matchTextDirection = false,
  this.gaplessPlayback = false,
  this.filterQuality = FilterQuality.low,
  this.loadStateChanged,
  this.shape,
  this.border,
  this.borderRadius,
  this.clipBehavior = Clip.antiAlias,
  this.enableLoadState = true,
  this.beforePaintImage,
  this.afterPaintImage,
  this.mode = ExtendedImageMode.none,
  this.enableMemoryCache = true,
  this.clearMemoryCacheIfFailed = true,
  this.onDoubleTap,
  this.initGestureConfigHandler,
  this.enableSlideOutPage = false,
  BoxConstraints? constraints,
  CancellationToken? cancelToken,
  int retries = 3,
  Duration? timeLimit,
  Map<String, String>? headers,
  bool cache = true,
  double scale = 1.0,
  Duration timeRetry = const Duration(milliseconds: 100),
  this.extendedImageEditorKey,
  this.initEditorConfigHandler,
  this.heroBuilderForSlidingPage,
  this.clearMemoryCacheWhenDispose = false,
  this.handleLoadingProgress = false,
  this.extendedImageGestureKey,
  int? cacheWidth,
  int? cacheHeight,
  this.isAntiAlias = false,
  String? cacheKey,
  bool printError = true,
  double? compressionRatio,
  int? maxBytes,
  bool cacheRawData = false,
  String? imageCacheName,
  Duration? cacheMaxAge,
})  : assert(cacheWidth == null || cacheWidth > 0),
      assert(cacheHeight == null || cacheHeight > 0),
      image = ExtendedResizeImage.resizeIfNeeded(
        provider: ExtendedNetworkImageProvider(
          url,
          scale: scale,
          headers: headers,
          cache: cache,
          cancelToken: cancelToken,
          retries: retries,
          timeRetry: timeRetry,
          timeLimit: timeLimit,
          cacheKey: cacheKey,
          printError: printError,
          cacheRawData: cacheRawData,
          imageCacheName: imageCacheName,
          cacheMaxAge: cacheMaxAge,
        ),
        compressionRatio: compressionRatio,
        maxBytes: maxBytes,
        cacheWidth: cacheWidth,
        cacheHeight: cacheHeight,
        cacheRawData: cacheRawData,
        imageCacheName: imageCacheName,
      ),
      assert(constraints == null || constraints.debugAssertIsValid()),
      constraints = (width != null || height != null)
          ? constraints?.tighten(width: width, height: height) ??
              BoxConstraints.tightFor(width: width, height: height)
          : constraints,
      assert(cacheWidth == null || cacheWidth > 0),
      assert(cacheHeight == null || cacheHeight > 0),
      super(key: key);