defaultAssetsProvider function

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

default ImageProviderFactory implementation of ImageType.assets.

Implementation

ImageProvider defaultAssetsProvider(Uri uri, ImageProviderParams params) {
  final String assetName = AssetsBundle.getAssetName(uri);
  return KrakenResizeImage.resizeIfNeeded(
    params.cachedWidth,
    params.cachedHeight,
    params.objectFit,
    AssetImage(assetName)
  );
}