parseImageUrl function
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');
}
}