saveTime method
save expiry time in milliseconds for this data
key - the key used to store the data
duration - duration of cache in seconds
Implementation
@override
void saveTime(String? key, int? duration) async {
if (!isInitialized) await init();
// duration = duration?.secondsToMilliseconds;
if (key != null && key.isNotEmpty && duration != null && !duration.isNaN) {
_prefs?.setInt('$key-time', duration);
}
}