parseImageUrl function

ImageType parseImageUrl(
  1. Uri resolvedUri, {
  2. String cache = 'auto',
})

Implementation

ImageType parseImageUrl(Uri resolvedUri, {String cache = 'auto'}) {
  if (resolvedUri.isScheme('HTTP') || resolvedUri.isScheme('HTTPS')) {
    return (cache == 'store' || cache == 'auto')
        ? ImageType.cached
        : ImageType.network;
  } else if (resolvedUri.isScheme('FILE')) {
    return ImageType.file;
  } else if (resolvedUri.isScheme('DATA')) {
    return ImageType.dataUrl;
  } else if (resolvedUri.isScheme('BLOB')) {
    return ImageType.blob;
  } else if (resolvedUri.isScheme('ASSETS')) {
    return ImageType.assets;
  } else {
    throw FlutterError('Uri must have it\'s scheme. $resolvedUri');
  }
}