defaultDataUrlProviderFactory function

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

default ImageProviderFactory implementation of ImageType.dataUrl.

Implementation

ImageProvider? defaultDataUrlProviderFactory(
    Uri uri, ImageProviderParams params) {
  return KrakenResizeImage.resizeIfNeeded(
    params.cachedWidth,
    params.cachedHeight,
    params.objectFit,
    MemoryImage((params as DataUrlImageProviderParams).bytes)
  );
}