save method

Future<CacheFile> save(
  1. String url
)

Saves the image into the repository

Implementation

Future<CacheFile> save(String url) async {
  String encodedUrl = Uri.encodeFull(url);

  CacheFile cacheFile = await repository.getByUrl(encodedUrl);

  if (cacheFile.isEmpty()) {
    cacheFile = await _downloadAndSave(url);
  }

  return cacheFile;
}