Created
April 16, 2018 16:16
-
-
Save xrigau/3aee31bf84000330c68d4f8a14b34321 to your computer and use it in GitHub Desktop.
Introduction to Redux in Flutter (main.dart)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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