From c565c214d0cf99d0841bc7d97a4c5e2c34b66092 Mon Sep 17 00:00:00 2001 From: Calcitem Date: Sun, 28 Mar 2021 12:07:34 +0800 Subject: [PATCH] flutter: theme: Add AppTheme.switchListTileActiveColor --- src/ui/flutter_app/lib/style/app_theme.dart | 2 ++ .../lib/widgets/game_settings_page.dart | 12 +++++----- .../lib/widgets/rule_settings_page.dart | 24 +++++++++---------- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/ui/flutter_app/lib/style/app_theme.dart b/src/ui/flutter_app/lib/style/app_theme.dart index e0772070..ff448027 100644 --- a/src/ui/flutter_app/lib/style/app_theme.dart +++ b/src/ui/flutter_app/lib/style/app_theme.dart @@ -99,4 +99,6 @@ class AppTheme { static const cardColor = UIColors.floralWhiteColor; static const cardMargin = const EdgeInsets.symmetric(vertical: 4.0, horizontal: 0); + + static const switchListTileActiveColor = UIColors.primaryColor; } diff --git a/src/ui/flutter_app/lib/widgets/game_settings_page.dart b/src/ui/flutter_app/lib/widgets/game_settings_page.dart index 75b4bc17..185291c3 100644 --- a/src/ui/flutter_app/lib/widgets/game_settings_page.dart +++ b/src/ui/flutter_app/lib/widgets/game_settings_page.dart @@ -569,14 +569,14 @@ class _GameSettingsPageState extends State { child: Column( children: [ SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.aiIsLazy, title: Text(S.of(context).passive, style: itemStyle), onChanged: setAiIsLazy, ), ListItemDivider(), SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.shufflingEnabled, title: Text(S.of(context).shufflingEnabled, style: itemStyle), @@ -593,7 +593,7 @@ class _GameSettingsPageState extends State { child: Column( children: [ SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.toneEnabled, title: Text(S.of(context).playSoundsInTheGame, style: itemStyle), @@ -610,7 +610,7 @@ class _GameSettingsPageState extends State { child: Column( children: [ SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: !Config.aiMovesFirst, title: Text( Config.aiMovesFirst @@ -630,7 +630,7 @@ class _GameSettingsPageState extends State { child: Column( children: [ SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.isAutoRestart, title: Text(S.of(context).isAutoRestart, style: itemStyle), onChanged: setIsAutoRestart, @@ -646,7 +646,7 @@ class _GameSettingsPageState extends State { child: Column( children: [ SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.isPieceCountInHandShown, title: Text(S.of(context).isPieceCountInHandShown, style: itemStyle), diff --git a/src/ui/flutter_app/lib/widgets/rule_settings_page.dart b/src/ui/flutter_app/lib/widgets/rule_settings_page.dart index 18657e68..4fe8784b 100644 --- a/src/ui/flutter_app/lib/widgets/rule_settings_page.dart +++ b/src/ui/flutter_app/lib/widgets/rule_settings_page.dart @@ -56,7 +56,7 @@ class _RuleSettingsPageState extends State { mainAxisSize: MainAxisSize.min, children: [ RadioListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, title: Text('6'), groupValue: Config.piecesCount, value: 6, @@ -64,7 +64,7 @@ class _RuleSettingsPageState extends State { ), ListItemDivider(), RadioListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, title: Text('9'), groupValue: Config.piecesCount, value: 9, @@ -72,7 +72,7 @@ class _RuleSettingsPageState extends State { ), ListItemDivider(), RadioListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, title: Text('12'), groupValue: Config.piecesCount, value: 12, @@ -215,7 +215,7 @@ class _RuleSettingsPageState extends State { ), ListItemDivider(), SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.hasDiagonalLines, title: Text(S.of(context).hasDiagonalLines, style: itemStyle), @@ -225,7 +225,7 @@ class _RuleSettingsPageState extends State { ), ListItemDivider(), SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.mayFly, title: Text(S.of(context).mayFly, style: itemStyle), subtitle: Text(S.of(context).mayFly_Detail, @@ -236,7 +236,7 @@ class _RuleSettingsPageState extends State { /* SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.maxStepsLedToDraw, title: Text(S.of(context).maxStepsLedToDraw, style: itemStyle), @@ -254,7 +254,7 @@ class _RuleSettingsPageState extends State { margin: AppTheme.cardMargin, child: Column(children: [ SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.hasBannedLocations, title: Text(S.of(context).hasBannedLocations, style: itemStyle), @@ -264,7 +264,7 @@ class _RuleSettingsPageState extends State { ), ListItemDivider(), SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.isBlackLoseButNotDrawWhenBoardFull, title: Text(S.of(context).isBlackLoseButNotDrawWhenBoardFull, style: itemStyle), @@ -282,7 +282,7 @@ class _RuleSettingsPageState extends State { margin: AppTheme.cardMargin, child: Column(children: [ SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.isDefenderMoveFirst, title: Text(S.of(context).isDefenderMoveFirst, style: itemStyle), @@ -292,7 +292,7 @@ class _RuleSettingsPageState extends State { ), ListItemDivider(), SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.isLoseButNotChangeSideWhenNoWay, title: Text(S.of(context).isLoseButNotChangeSideWhenNoWay, style: itemStyle), @@ -310,7 +310,7 @@ class _RuleSettingsPageState extends State { margin: AppTheme.cardMargin, child: Column(children: [ SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.mayRemoveFromMillsAlways, title: Text(S.of(context).mayRemoveFromMillsAlways, style: itemStyle), @@ -320,7 +320,7 @@ class _RuleSettingsPageState extends State { ), ListItemDivider(), SwitchListTile( - activeColor: UIColors.primaryColor, + activeColor: AppTheme.switchListTileActiveColor, value: Config.mayRemoveMultiple, title: Text(S.of(context).mayRemoveMultiple, style: itemStyle),