Skip to content
This repository has been archived by the owner on Apr 25, 2022. It is now read-only.

Commit

Permalink
refactor(settings): reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
CCXXXI committed Oct 2, 2021
1 parent 8bed1d3 commit 42b8470
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions lib/settings/settings_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,25 @@ class SettingsPage extends StatelessWidget {
onTap: logic.login,
);

Widget launchPage() => DropDownSettingsTile(
title: '启动页',
settingKey: 'launchPage',
values: const {
0: '工具箱',
1: '课程表',
2: '设置',
// region theme
Widget dark() => DropDownSettingsTile(
title: '深色模式',
settingKey: 'themeMode',
values: {
ThemeMode.system.index: '跟随系统',
ThemeMode.dark.index: '开',
ThemeMode.light.index: '关',
},
selected: 1,
selected: ThemeMode.system.index,
onChange: logic.updateTheme,
);

Widget font() => SimpleDropDownSettingsTile(
title: '字体',
settingKey: 'font',
values: const [fontSans, fontSerif],
selected: fontSans,
onChange: logic.updateTheme,
);

Widget color() => SwitchSettingsTile(
Expand All @@ -65,23 +75,19 @@ class SettingsPage extends StatelessWidget {
],
);

Widget dark() => DropDownSettingsTile(
title: '深色模式',
settingKey: 'themeMode',
values: {
ThemeMode.system.index: '跟随系统',
ThemeMode.dark.index: '开',
ThemeMode.light.index: '关',
//endregion

// region misc
Widget launchPage() => DropDownSettingsTile(
title: '启动页',
settingKey: 'launchPage',
values: const {
0: '工具箱',
1: '课程表',
2: '设置',
},
selected: ThemeMode.system.index,
onChange: logic.updateTheme,
selected: 1,
);

Widget font() => SimpleDropDownSettingsTile(
title: '字体',
settingKey: 'font',
values: const [fontSans, fontSerif],
selected: fontSans,
onChange: logic.updateTheme,
);
// endregion
}

0 comments on commit 42b8470

Please sign in to comment.