redux_persist_flutter pub package

Flutter Storage Engine for redux_persist.

Can either save to shared_preferences (default, recommended), or your application document directory.

Defaults to saving to shared_preferences (recommended).

To save to a file in your application document directory, simply change the location:


var persistor = new Persistor<AppState>(
  // ...
  storage: new FlutterStorage("my-app"),


By default, it saves to FlutterSaveLocation.sharedPreference (shared_preferences, recommended).

You can also save to your application document directory by using FlutterSaveLocation.documentFile:

new FlutterStorage("my-app", location: FlutterSaveLocation.documentFile)


If you want to wait until rendering you app until the state is loaded, use the PersistorGate:

Widget build(BuildContext context) {
  return new PersistorGate(
    persistor: persistor,
    builder: (context) => MyApp(),

If you want to display a loading/slash screen while loading, pass a widget to render to the loading param of PersistorGate:

new PersistorGate(
  persistor: persistor,
  loading: SlashScreen(), // !!!
  builder: (context) => MyApp(),

Features and bugs

Please file feature requests and bugs at the issue tracker.