redux_persist_flutter 0.8.2 redux_persist_flutter: ^0.8.2 copied to clipboard
Redux Persist Flutter Integration with custom storage engines
redux_persist_flutter #
Flutter Storage Engine for redux_persist
.
Can either save to your application document directory
(default, recommended), or shared_preferences
.
Usage #
final persistor = Persistor<State>(
// ...
storage: FlutterStorage(),
);
It is recommended to load initial state before calling runApp
to let Flutter
show the slash screen until we are ready to render.
Locations #
By default, it saves to FlutterSaveLocation.documentFile
(application document directory, recommended).
You can also save to your shared preferences by using FlutterSaveLocation.sharedPreferences
:
// Use shared preferences
FlutterStorage(location: FlutterSaveLocation.sharedPreferences);
// Use document file
FlutterStorage(location: FlutterSaveLocation.documentFile);
Key #
You can pass a key
argument to FlutterStorage
to provide a key
for the file name (document file) or the shared preference key.
Features and bugs #
Please file feature requests and bugs at the issue tracker.