Skip to content

massa-org/riverpod_persistent_state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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',
  ),
);

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages