readyImageProvider method

ImageProvider<Object> readyImageProvider({
  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. HeadersCallBack? headers,
  9. BaseCacheManager? cacheManager,
})

create ImageProvider with respect of global config

Implementation

ImageProvider readyImageProvider({
  required String path,
  Uri Function(String path)? resolveUrl,
  ImageRenderMethodForWeb? imageRenderMethodForWeb,
  int? maxHeight,
  int? maxWidth,
  double scale = 1.0,
  String? cacheKey,
  HeadersCallBack? headers,
  BaseCacheManager? cacheManager,
}) {
  var config = ReadyImageConfig.of(this);
  return 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,
  );
}