NotifierPersistX<StateT, ValueT> extension

Adds persist method to AnyNotifier.

This is separate from AnyNotifier because it is experimental.

on
Annotations
  • @publicInPersist

Methods

persist<KeyT, EncodedT>(FutureOr<Storage<KeyT, EncodedT>> storage, {required KeyT key, required EncodedT encode(ValueT state), required ValueT decode(EncodedT encoded), StorageOptions options = const StorageOptions()}) PersistResult

Available on AnyNotifier<StateT, ValueT>, provided by the NotifierPersistX extension

Persist the state of a provider to a database.