load method

  1. @override
Future<T?> load()
override

Implementation

@override
Future<T?> load() async {
  try {
    final stored = await read(key);
    if (stored == null) return null;
    final json = jsonDecode(stored) as Map<String, dynamic>;
    return fromJson(json);
  } catch (e) {
    if (kDebugMode) print('JsonPersistence load error: $e');
    return null;
  }
}