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) => _decodeOrFallback(rawValue, finalInitialValue),
    toValue: (value) => jsonEncode(value),
    initialValue: finalInitialValue,
  );
}