Skip to content

Commit

Permalink
Merge pull request #33 from mattreid1/precache-dev
Browse files Browse the repository at this point in the history
Added pre-cache function
  • Loading branch information
mattreid1 authored Dec 23, 2021
2 parents 08a7c0a + ab478da commit 97fb1e2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/src/firebase_image.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ class FirebaseImage extends ImageProvider<FirebaseImage> {
return _fetchImage();
}

/// Pre-caches an image
Future<void> 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}';
Expand Down

0 comments on commit 97fb1e2

Please sign in to comment.