http_get_cache 0.0.2 copy "http_get_cache: ^0.0.2" to clipboard
http_get_cache: ^0.0.2 copied to clipboard

A cache wrapper for http get requests

HTTP Get Cache #

A cache wrapper for http GET requests This helps you achieve an "offline mode" for your flutter application.

Installation #

In your pubspec.yaml add to your dependencies

http_get_cache: <current_version>

Usage #

First, Initialize GetCache.

GetCache.initialize();

blackList is an optional param that lists the url paths you want to exclude in your cache

GetCach.initialize(blackList: ["/v1/current"]);

You can then go ahead and use this as your http getter.

Uri uri = Uri.https("url.com", query: {"name": "my_name"});
Response response = await GetCache.instance.get(uri, headers: {"token": "my_token"})

What Happens #

When the underlying get request fails, GetCache then returns a cached response for the corresponding request path.

6
likes
110
pub points
28%
popularity

Publisher

unverified uploader

A cache wrapper for http get requests

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, get_storage, http

More

Packages that depend on http_get_cache