File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Future main() async {
11
11
12
12
final store = await configureStore <AppState >((builder) {
13
13
builder.withReducer (reducer);
14
- builder.withPreloadedState (AppState (status : {}, todos : List . unmodifiable ([]) ));
14
+ builder.withPreloadedState (AppState . initialState ( ));
15
15
16
16
if (Config .reduxDevtoolsEnabled) {
17
17
builder.usingDevtools (Config .reduxDevtoolsUrl);
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ class AppState {
12
12
13
13
AppState ({this .status, this .todos});
14
14
15
- factory AppState .fromJson (Map <String , dynamic > json) => _$AppStateFromJson (json);
15
+ factory AppState .initialState () =>
16
+ AppState (status: Map .unmodifiable ({}), todos: List .unmodifiable ([]));
17
+
18
+ factory AppState .fromJson (Map <String , dynamic > json) =>
19
+ _$AppStateFromJson (json);
16
20
Map <String , dynamic > toJson () => _$AppStateToJson (this );
17
21
}
You can’t perform that action at this time.
0 commit comments