protected static method

Async<TSharedProtectedIntPod> protected(
  1. String key, {
  2. int? initialValue,
})

Implementation

static Async<TSharedProtectedIntPod> protected(
  String key, {
  int? initialValue,
}) {
  final finalInitialValue = initialValue ?? 0;
  return TSharedProtectedIntPod.create(
    key,
    fromValue: (rawValue) => rawValue ?? finalInitialValue,
    toValue: (value) => value,
    initialValue: finalInitialValue,
  );
}