getIfNotExpired static method
Implementation
static dynamic getIfNotExpired(String key) {
final String expiryKey = "_expiry_$key";
final int? expiryTime = _sp.getInt(expiryKey);
if (expiryTime != null && DateTime.now().millisecondsSinceEpoch > expiryTime) {
remove(key);
remove(expiryKey);
return null;
}
return _sp.get(key);
}