Cache Manager using GetStorage with time expiration.
This is based on @ozkayas's code.
To use this file, you need to be using:
So, to add them to the project, you just need to run:
flutter pub add get
and
flutter pub add get_storage
To use, you just have to declare the class like this:
class ... extends GetxController with CacheManager {
}
and then, when you need, just call the function you need:
saveValue(value, CacheManagerKey.userToken)
getValueFrom(CacheManagerKey.userToken)
removeValueFrom(CacheManagerKey.userToken)
removeAllCacheData()
isValid(ExpirationTime.inDays, 3, savedValue.lastSaved)