getItem method

  1. @override
Future<String?> getItem({
  1. required String key,
  2. String? defaultValue,
})
override

Implementation

@override
Future<String?> getItem({
  required String key,
  String? defaultValue,
}) async {
  final SharedPreferences prefs = await _prefs;
  final String storageKey = _getStorageKey(key);
  final String? result = prefs.getString(storageKey);
  if (result == null) {
    return defaultValue;
  }
  return result;
}