restorableState<V> static method
Creates a RestorableCell with the given restorationId and
initial.
Parameters:
restorationId: Unique Persistence Key. Must be unique within the registering CellRestorationScope.initial: Fresh-Install Value. Used when no persisted data exists.fromPrimitives/toPrimitives: Optional Codecs. Required for non-primitiveV; defaults to the primitive codec described on RestorableCell.
Returns:
A RestorableCell that behaves exactly like Cell.state's result until it is registered with a CellRestorationScope.
Implementation
static RestorableCell<V> restorableState<V>({
required String restorationId,
V? initial,
V? Function(Object? data)? fromPrimitives,
Object? Function(V? value)? toPrimitives,
}) =>
RestorableCell<V>(
restorationId: restorationId,
initial: initial,
fromPrimitives: fromPrimitives,
toPrimitives: toPrimitives,
);