getValue method
- SharedPreferences preferences,
- String key
override
Retrieve a value associated with the key by using the preferences.
Implementation
@override
Duration? getValue(preferences, key) {
final seconds = preferences.getInt(key);
if (seconds == null || seconds < 0) return null;
return Duration(seconds: seconds);
}