Skip to content

Commit c2f9f4f

Browse files
committed
注释
1 parent f3cd9b4 commit c2f9f4f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/common/redux/GSYState.dart

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,22 @@ class GSYState {
2525
///用户接受到的事件列表
2626
List<TrendingRepoModel> trendList = new List();
2727

28+
///主题数据
2829
ThemeData themeData;
2930

31+
///语言
3032
Locale locale;
3133

34+
///当前手机平台默认语言
3235
Locale platformLocale;
3336

3437
///构造方法
3538
GSYState({this.userInfo, this.eventList, this.trendList, this.themeData, this.locale});
3639
}
3740

38-
///通过 Reducer 创建 store 保存的 GSYState
41+
///创建 Reducer
42+
///源码中 Reducer 是一个方法 typedef State Reducer<State>(State state, dynamic action);
43+
///我们自定义了 appReducer 用于创建 store
3944
GSYState appReducer(GSYState state, action) {
4045
return GSYState(
4146
///通过 UserReducer 将 GSYState 内的 userInfo 和 action 关联在一起
@@ -47,8 +52,10 @@ GSYState appReducer(GSYState state, action) {
4752
///通过 TrendReducer 将 GSYState 内的 trendList 和 action 关联在一起
4853
trendList: TrendReducer(state.trendList, action),
4954

55+
///通过 ThemeDataReducer 将 GSYState 内的 themeData 和 action 关联在一起
5056
themeData: ThemeDataReducer(state.themeData, action),
5157

58+
///通过 LocaleReducer 将 GSYState 内的 locale 和 action 关联在一起
5259
locale: LocaleReducer(state.locale, action),
5360
);
5461
}

0 commit comments

Comments
 (0)