Skip to content

Instantly share code, notes, and snippets.

@panthe
Last active October 17, 2020 13:06
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 panthe/7cbc61676f1868d51be9e7da707ae40e to your computer and use it in GitHub Desktop.
Save panthe/7cbc61676f1868d51be9e7da707ae40e to your computer and use it in GitHub Desktop.
Redux connection to application
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