protected static method

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

Implementation

static Async<TSharedProtectedJsonPod> protected(
  String key, {
  Map<String, Object>? initialValue,
}) {
  final finalInitialValue = initialValue ?? const {};
  return TSharedProtectedJsonPod.create(
    key,
    fromValue: (rawValue) => rawValue != null
        ? jsonDecode(rawValue) as Map<String, Object>
        : finalInitialValue,
    toValue: (value) => jsonEncode(value),
    initialValue: finalInitialValue,
  );
}