get<TType> method

dynamic get<TType>(
  1. String key
)

Retrieves a persistent data stored in SharedPreferences You can use your own types here but in this case you need to add json encoders / revivers so that jsonEncode / jsonDecode could understand how to work with your type

Implementation

dynamic get<TType>(String key) {
  final value = _hiveBox?.get(key);
  if (value is String && value.contains('{')) {
    return _reviveValue(key, value) as dynamic;
  }
  return value;
}