Skip to content

Instantly share code, notes, and snippets.

@xrigau
Created April 16, 2018 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xrigau/3aee31bf84000330c68d4f8a14b34321 to your computer and use it in GitHub Desktop.
Save xrigau/3aee31bf84000330c68d4f8a14b34321 to your computer and use it in GitHub Desktop.
Introduction to Redux in Flutter (main.dart)
void main() => runApp(ToDoListApp());
class ToDoListApp extends StatelessWidget {
final Store<AppState> store = Store<AppState>(
appReducer, /* Function defined in the reducers file */
initialState: AppState.initial(),
middleware: createStoreMiddleware(),
);
@override
Widget build(BuildContext context) => StoreProvider(
store: this.store,
child: MaterialApp(
// Omitting some boilerplate here
home: ToDoListPage(title: 'Flutter Demo Home Page'),
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment