protected static method

Future<TSharedProtectedJsonPod> protected(
  1. String key, {
  2. Map<String, dynamic>? initialValue,
})

Implementation

static Future<TSharedProtectedJsonPod> protected(
  String key, {
  Map<String, dynamic>? initialValue,
}) async {
  final instance = TSharedProtectedJsonPod(
    key,
    fromValue: (value) =>
        value != null ? jsonDecode(value) as Map<String, dynamic> : null,
    toValue: (rawValue) => jsonEncode(rawValue),
    initialValue: initialValue,
  );
  await instance.refresh();
  return instance;
}