riverpod_persistent_state

Last updated:

0 purchases

riverpod_persistent_state Image
riverpod_persistent_state Images
Add to Cart

Description:

riverpod persistent state

Persistent riverpod store based on hive
Features #
Store state in persistent memory and restore it after application restarts
Getting started #
install #
Execute script in project directory, or add dependency in pubspec.yaml
flutter pub add riverpod_persistent_state
copied to clipboard
Usage #
Define provider with unique name and use it as state provider after
final tokenProvider = PersistentStateProvider<AuthorizationValue>(
store: HiveJsonStore(
defaultValue: () => const AuthorizationValue.unauthorized()
fromJson: (json) => AuthorizationValue.fromJson(json),
boxName: 'token',
),
);
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.