defaultNetworkProviderFactory function

ImageProvider<Object> defaultNetworkProviderFactory(
  1. Uri uri,
  2. ImageProviderParams params
)

default ImageProviderFactory implementation of ImageType.network

Implementation

ImageProvider defaultNetworkProviderFactory(
    Uri uri, ImageProviderParams params) {
  NetworkImage networkImage = NetworkImage(uri.toString(), headers: {
    HttpHeaders.userAgentHeader: NavigatorModule.getUserAgent(),
    HttpHeaderContext:
        (params as CachedNetworkImageProviderParams).contextId.toString(),
  });
  return KrakenResizeImage.resizeIfNeeded(
    params.cachedWidth,
    params.cachedHeight,
    params.objectFit,
    networkImage
  );
}