Last active
October 17, 2020 13:06
-
-
Save panthe/7cbc61676f1868d51be9e7da707ae40e to your computer and use it in GitHub Desktop.
Redux connection to application
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(App()); | |
} | |
class App extends StatelessWidget { | |
final Store<AppState> store = createStore(); | |
@override | |
Widget build(BuildContext context) { | |
return StoreProvider<AppState>( | |
store: store, | |
child: MaterialApp( | |
debugShowCheckedModeBanner: false, | |
title: 'Flutter Web with Redux', | |
theme: ThemeData( | |
primarySwatch: Colors.orange, | |
dividerColor: Colors.grey[300], | |
primaryColor: Colors.orange, | |
backgroundColor: Colors.grey[200], | |
cardColor: Colors.white, | |
), | |
home: Scaffold( | |
key: Keys.scaffoldKey, | |
body: SafeArea( | |
child: ErrorNotifier( | |
child: MessageNotifier( | |
child: HomePage(), | |
), | |
), | |
), | |
), | |
routes: { | |
'/home': (context) => HomePage(), | |
}, | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment