resource_cache 0.87.0 copy "resource_cache: ^0.87.0" to clipboard
resource_cache: ^0.87.0 copied to clipboard

Dart library that retrieves and maintains a cache of remote URL content, abstracting away the remote resource (between remote and local files).

example/main.dart

import "dart:io";
import "package:resource_cache/resource_cache.dart";

void main() async {

  //Directory that the cache directory will be created within.
  Directory d = Directory.systemTemp;

  //create the cache, passing in the root directory.
  var cache = ResourceCache(d);

  //Url to retrieve
  var url = "http://mikechambers.com/blog/images/posts/twitchlivefirefox/screenshot.png";

  //This returns a Uri. It will be a file:/ uri if the file was already cached, or
  //succesfully cached.
  //It the original Uri if there was an error, or the file could not be cached.
  File f = await cache.retrieve(url);

  print(f.path);
  exit(0);
}
0
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Dart library that retrieves and maintains a cache of remote URL content, abstracting away the remote resource (between remote and local files).

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

crypto

More

Packages that depend on resource_cache