diff --git a/lib/src/firebase_image.dart b/lib/src/firebase_image.dart index 414c359..b37b571 100644 --- a/lib/src/firebase_image.dart +++ b/lib/src/firebase_image.dart @@ -54,6 +54,12 @@ class FirebaseImage extends ImageProvider { return _fetchImage(); } + /// Pre-caches an image + Future preCache() async { + if (shouldCache == false) throw "Caching must be enabled to pre-cache an image."; + await _fetchImage(); + } + static String _getBucket(String location) { final uri = Uri.parse(location); return '${uri.scheme}://${uri.authority}';