-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.dart
37 lines (32 loc) · 817 Bytes
/
main.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import 'package:flutter/material.dart';
import 'package:redux/redux.dart';
import 'package:redux_thunk/redux_thunk.dart';
import 'package:flutter_redux/flutter_redux.dart';
import 'store/main.dart';
import 'pages/home/main.dart';
void main() {
final store = Store<AppState>(
reducers,
middleware: [thunkMiddleware],
initialState: AppState.initialState(),
);
runApp(MyApp(
title: 'Flutter Redux Demo',
store: store,
));
}
class MyApp extends StatelessWidget {
final Store<AppState> store;
final String title;
MyApp({Key key, this.store, this.title}) : super(key: key);
@override
Widget build(BuildContext context) {
return StoreProvider<AppState>(
store: store,
child: MaterialApp(
theme: ThemeData.dark(),
home: Home(),
),
);
}
}