restore method
Restores the persisted value.
Implementation
Future<void> restore() async {
try {
final data = _sharedPreferences.getString(key);
if (data != null) {
_isRestoring = true;
value = decoder(data);
_lastSavedValue = data;
_isRestoring = false;
debugPrint('PERSISTRO: Restored $key: $data');
}
} catch (e) {
debugPrint('PERSISTRO: Error restoring $key: $e');
}
}