api_cache_manager
API Cache Manager is a Utility package built with Flutter SDK and SQLite Package. This package will help to make your Rest API store in the local db for offline access.
Features
- Offline Integration of Rest API.
- Faster Data rendering.
- Avoid Unnecessary HTTP Get Requests.
- App will work without Internet also.
- Speed up the application.
Install
Add this to your pubspec.yaml file:
dependencies:
api_cache_manager: ^1.0.1
Usage
The cache manager can be used to store the rest api data in the local db for offline access.
var cacheData = await APICacheManager().addCacheData(APICacheDBModel);
isAPICacheKeyExist(keyName)
returns true/false based on the key name.
addCacheData(APICacheDBModel)
save the Rest API data in the local DB with APICacheDBModel(key, syncData).
getCacheData(keyName)
return the cache data on the basis of key name.
deleteCache(keyName)
this will remove the specific cache from the db on the basis of keyname.
emptyCache
removes all the data from the cache.
Donate
If you like my work, you can support me buying a cup of :coffee:
Copyright & License
Code and documentation Copyright 2021 SnippetCoder. Code released under the Apache License. Docs released under Creative Commons.