flutter: theme: Add AppTheme.switchListTileActiveColor

This commit is contained in:
Calcitem 2021-03-28 12:07:34 +08:00
parent 7bdcd2bf85
commit c565c214d0
3 changed files with 20 additions and 18 deletions

View File

@ -99,4 +99,6 @@ class AppTheme {
static const cardColor = UIColors.floralWhiteColor; static const cardColor = UIColors.floralWhiteColor;
static const cardMargin = static const cardMargin =
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 0); const EdgeInsets.symmetric(vertical: 4.0, horizontal: 0);
static const switchListTileActiveColor = UIColors.primaryColor;
} }

View File

@ -569,14 +569,14 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.aiIsLazy, value: Config.aiIsLazy,
title: Text(S.of(context).passive, style: itemStyle), title: Text(S.of(context).passive, style: itemStyle),
onChanged: setAiIsLazy, onChanged: setAiIsLazy,
), ),
ListItemDivider(), ListItemDivider(),
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.shufflingEnabled, value: Config.shufflingEnabled,
title: title:
Text(S.of(context).shufflingEnabled, style: itemStyle), Text(S.of(context).shufflingEnabled, style: itemStyle),
@ -593,7 +593,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.toneEnabled, value: Config.toneEnabled,
title: Text(S.of(context).playSoundsInTheGame, title: Text(S.of(context).playSoundsInTheGame,
style: itemStyle), style: itemStyle),
@ -610,7 +610,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: !Config.aiMovesFirst, value: !Config.aiMovesFirst,
title: Text( title: Text(
Config.aiMovesFirst Config.aiMovesFirst
@ -630,7 +630,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.isAutoRestart, value: Config.isAutoRestart,
title: Text(S.of(context).isAutoRestart, style: itemStyle), title: Text(S.of(context).isAutoRestart, style: itemStyle),
onChanged: setIsAutoRestart, onChanged: setIsAutoRestart,
@ -646,7 +646,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.isPieceCountInHandShown, value: Config.isPieceCountInHandShown,
title: Text(S.of(context).isPieceCountInHandShown, title: Text(S.of(context).isPieceCountInHandShown,
style: itemStyle), style: itemStyle),

View File

@ -56,7 +56,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
RadioListTile( RadioListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
title: Text('6'), title: Text('6'),
groupValue: Config.piecesCount, groupValue: Config.piecesCount,
value: 6, value: 6,
@ -64,7 +64,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
), ),
ListItemDivider(), ListItemDivider(),
RadioListTile( RadioListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
title: Text('9'), title: Text('9'),
groupValue: Config.piecesCount, groupValue: Config.piecesCount,
value: 9, value: 9,
@ -72,7 +72,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
), ),
ListItemDivider(), ListItemDivider(),
RadioListTile( RadioListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
title: Text('12'), title: Text('12'),
groupValue: Config.piecesCount, groupValue: Config.piecesCount,
value: 12, value: 12,
@ -215,7 +215,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
), ),
ListItemDivider(), ListItemDivider(),
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.hasDiagonalLines, value: Config.hasDiagonalLines,
title: title:
Text(S.of(context).hasDiagonalLines, style: itemStyle), Text(S.of(context).hasDiagonalLines, style: itemStyle),
@ -225,7 +225,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
), ),
ListItemDivider(), ListItemDivider(),
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.mayFly, value: Config.mayFly,
title: Text(S.of(context).mayFly, style: itemStyle), title: Text(S.of(context).mayFly, style: itemStyle),
subtitle: Text(S.of(context).mayFly_Detail, subtitle: Text(S.of(context).mayFly_Detail,
@ -236,7 +236,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
/* /*
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.maxStepsLedToDraw, value: Config.maxStepsLedToDraw,
title: title:
Text(S.of(context).maxStepsLedToDraw, style: itemStyle), Text(S.of(context).maxStepsLedToDraw, style: itemStyle),
@ -254,7 +254,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
margin: AppTheme.cardMargin, margin: AppTheme.cardMargin,
child: Column(children: <Widget>[ child: Column(children: <Widget>[
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.hasBannedLocations, value: Config.hasBannedLocations,
title: title:
Text(S.of(context).hasBannedLocations, style: itemStyle), Text(S.of(context).hasBannedLocations, style: itemStyle),
@ -264,7 +264,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
), ),
ListItemDivider(), ListItemDivider(),
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.isBlackLoseButNotDrawWhenBoardFull, value: Config.isBlackLoseButNotDrawWhenBoardFull,
title: Text(S.of(context).isBlackLoseButNotDrawWhenBoardFull, title: Text(S.of(context).isBlackLoseButNotDrawWhenBoardFull,
style: itemStyle), style: itemStyle),
@ -282,7 +282,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
margin: AppTheme.cardMargin, margin: AppTheme.cardMargin,
child: Column(children: <Widget>[ child: Column(children: <Widget>[
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.isDefenderMoveFirst, value: Config.isDefenderMoveFirst,
title: title:
Text(S.of(context).isDefenderMoveFirst, style: itemStyle), Text(S.of(context).isDefenderMoveFirst, style: itemStyle),
@ -292,7 +292,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
), ),
ListItemDivider(), ListItemDivider(),
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.isLoseButNotChangeSideWhenNoWay, value: Config.isLoseButNotChangeSideWhenNoWay,
title: Text(S.of(context).isLoseButNotChangeSideWhenNoWay, title: Text(S.of(context).isLoseButNotChangeSideWhenNoWay,
style: itemStyle), style: itemStyle),
@ -310,7 +310,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
margin: AppTheme.cardMargin, margin: AppTheme.cardMargin,
child: Column(children: <Widget>[ child: Column(children: <Widget>[
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.mayRemoveFromMillsAlways, value: Config.mayRemoveFromMillsAlways,
title: Text(S.of(context).mayRemoveFromMillsAlways, title: Text(S.of(context).mayRemoveFromMillsAlways,
style: itemStyle), style: itemStyle),
@ -320,7 +320,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
), ),
ListItemDivider(), ListItemDivider(),
SwitchListTile( SwitchListTile(
activeColor: UIColors.primaryColor, activeColor: AppTheme.switchListTileActiveColor,
value: Config.mayRemoveMultiple, value: Config.mayRemoveMultiple,
title: title:
Text(S.of(context).mayRemoveMultiple, style: itemStyle), Text(S.of(context).mayRemoveMultiple, style: itemStyle),