create static method

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

Implementation

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