assetEntityToImageProvider static method

ImageProvider<Object>? assetEntityToImageProvider(
  1. ExtendedAssetEntity assetEntity
)

fileAsync > previewUrl > previewPath

Implementation

static ImageProvider? assetEntityToImageProvider(
    ExtendedAssetEntity assetEntity) {
  ImageProvider? provider;
  if (assetEntity.renovated != null) {
    provider = ExtendedImageWithAssetsPicker.buildImageProvider(
        assetEntity.renovated);
  } else if (assetEntity.fileAsync != null) {
    provider = ExtendedFileImageProvider(assetEntity.fileAsync!);
  } else if (assetEntity.previewed != null) {
    final previewed = assetEntity.previewed!;
    if (previewed.startsWith('http')) {
      provider = ExtendedNetworkImageProvider(previewed);
    } else {
      provider = ExtendedAssetImageProvider(previewed);
    }
  }
  return provider;
}