redux_persist_flutter 0.9.0 copy "redux_persist_flutter: ^0.9.0" to clipboard
redux_persist_flutter: ^0.9.0 copied to clipboard

Redux Persist Flutter Integration with custom storage engines

redux_persist_flutter pub package #

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(),
);
copied to clipboard

It is recommended to load initial state before calling runApp to let Flutter show the splash 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);
copied to clipboard

Flutter Web #

Flutter Web is supported using the shared_preferences (FlutterSaveLocation.sharedPreferences) storage.

Key #

You can pass a key argument to FlutterStorage to provide a key for the file name (document file) or the shared preference key.

Backups #

Android may keep files around after uninstalling an app. If you don't want this behaviour, add android:allowBackup="false" to <application> in android/app/src/main/AndroidManifest.xml.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

21
likes
160
points
2.01k
downloads

Publisher

verified publishercretezy.com

Weekly Downloads

2024.09.13 - 2025.03.28

Redux Persist Flutter Integration with custom storage engines

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, path_provider, redux_persist, shared_preferences

More

Packages that depend on redux_persist_flutter