readyImageDecoration method

DecorationImage readyImageDecoration({
  1. required String path,
  2. Uri resolveUrl(
    1. String path
    )?,
  3. ImageRenderMethodForWeb? imageRenderMethodForWeb,
  4. int? maxHeight,
  5. int? maxWidth,
  6. double scale = 1.0,
  7. String? cacheKey,
  8. BoxFit? fit,
  9. HeadersCallBack? headers,
  10. BaseCacheManager? cacheManager,
  11. void onError(
    1. Object,
    2. StackTrace?
    )?,
  12. ColorFilter? colorFilter,
  13. AlignmentGeometry alignment = Alignment.center,
  14. Rect? centerSlice,
  15. ImageRepeat repeat = ImageRepeat.noRepeat,
  16. bool matchTextDirection = false,
  17. double opacity = 1.0,
  18. FilterQuality filterQuality = FilterQuality.low,
  19. bool invertColors = false,
  20. bool isAntiAlias = false,
})

create DecorationImage with respect of global config

Implementation

DecorationImage readyImageDecoration({
  required String path,
  Uri Function(String path)? resolveUrl,
  ImageRenderMethodForWeb? imageRenderMethodForWeb,
  int? maxHeight,
  int? maxWidth,
  double scale = 1.0,
  String? cacheKey,
  BoxFit? fit,
  HeadersCallBack? headers,
  BaseCacheManager? cacheManager,
  void Function(Object, StackTrace?)? onError,
  ColorFilter? colorFilter,
  AlignmentGeometry alignment = Alignment.center,
  Rect? centerSlice,
  ImageRepeat repeat = ImageRepeat.noRepeat,
  bool matchTextDirection = false,
  double opacity = 1.0,
  FilterQuality filterQuality = FilterQuality.low,
  bool invertColors = false,
  bool isAntiAlias = false,
}) {
  var config = ReadyImageConfig.of(this);
  return DecorationImage(
    fit: fit ?? config?.fit?.call(this) ?? BoxFit.cover,
    onError: onError,
    colorFilter: colorFilter,
    alignment: alignment,
    centerSlice: centerSlice,
    repeat: repeat,
    opacity: opacity,
    matchTextDirection: matchTextDirection,
    filterQuality: filterQuality,
    invertColors: invertColors,
    isAntiAlias: isAntiAlias,
    image: CachedNetworkImageProvider(
      (resolveUrl ?? config?.resolveUrl)?.call(path).toString() ?? path,
      maxHeight: maxHeight,
      maxWidth: maxWidth,
      scale: scale,
      headers: (headers ?? config?.headers)?.call(this),
      cacheManager: cacheManager ?? config?.cacheManager?.call(this),
      cacheKey: cacheKey,
      imageRenderMethodForWeb: imageRenderMethodForWeb ??
          config?.imageRenderMethodForWeb?.call(this) ??
          ImageRenderMethodForWeb.HtmlImage,
    ),
  );
}