flutter: app_theme.dart: Remove some styles

This commit is contained in:
Calcitem 2021-04-04 18:19:34 +08:00
parent 46ddc5aecd
commit e8a62bfbc6
8 changed files with 51 additions and 52 deletions

View File

@ -32,11 +32,18 @@ class AppTheme {
static var lightBackgroundColor = UIColors.papayaWhip;
static var listTileSubtitleColor = Color(0x99461220);
static var listItemDividerColor = Color(0x336D000D);
static var switchListTileActiveColor = dialogTitleColor;
static var switchListTileTitleColor = UIColors.crusoe;
static const cardColor = UIColors.floralWhite;
static const settingsHeaderTextColor = UIColors.crusoe;
/// Help page
static var helpBackgroundColor = boardBackgroundColor;
static var helpTextColor = boardBackgroundColor;
/// About
static var aboutPageBackgroundColor = lightBackgroundColor;
/// Drawer
static var drawerColor = Colors.white;
static var drawerBackgroundColor = UIColors.notWhite.withOpacity(0.5); // TODO
@ -63,39 +70,6 @@ class AppTheme {
Colors.red,
];
// Style
static var gamePageTipStyle = TextStyle(fontSize: 16, color: tipTextColor);
static const cardColor = UIColors.floralWhite;
static const cardMargin =
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 0);
static const settingsHeaderStyle =
TextStyle(color: UIColors.crusoe, fontSize: 20.0);
static var switchListTileActiveColor = dialogTitleColor;
static var switchListTileTitleStyle = TextStyle(color: UIColors.crusoe);
static var moveHistoryTextStyle =
TextStyle(fontSize: 18, height: 1.5, color: moveHistoryTextColor);
static var aboutPageBackgroundColor = lightBackgroundColor;
static double copyrightFontSize = 12;
static var versionDialogAppNameTextStyle = TextStyle(color: dialogTitleColor);
static var versionDialogCopyrightTextStyle = TextStyle(
fontSize: AppTheme.copyrightFontSize,
);
static double boardBorderRadius = 5;
static var boardPadding = 5.0;
static const double drawerWidth = 250;
static double boardMargin = 10.0;
static var boardScreenPaddingH = 10.0;
// Theme
static const sliderThemeData = SliderThemeData(
@ -119,6 +93,27 @@ class AppTheme {
valueIndicatorTextStyle: TextStyle(fontSize: 24),
);
// Misc
static const SizedBox sizedBox = SizedBox(height: 16);
// Style
static var moveHistoryTextStyle =
TextStyle(fontSize: 18, height: 1.5, color: moveHistoryTextColor);
static double boardMargin = 10.0;
static double boardScreenPaddingH = 10.0;
static double boardBorderRadius = 5.0;
static double boardPadding = 5.0;
static var gamePageTipStyle = TextStyle(fontSize: 16, color: tipTextColor);
static const settingsHeaderStyle =
TextStyle(color: settingsHeaderTextColor, fontSize: 20.0);
static const cardMargin =
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 0);
static const double drawerWidth = 250.0;
static const double sizedBoxHeight = 16.0;
static double copyrightFontSize = 12;
}

View File

@ -88,7 +88,7 @@ class _AboutPageState extends State<AboutPage> {
/*
ListTile(
title: Text(S.of(context).viewInGooglePlayStore,
style: AppTheme.switchListTileTitleStyle),
style: TextStyle(color: AppTheme.switchListTileTitleColor)),
onTap: () => _launchURL(
'https://play.google.com/store/apps/details?id=com.calcitem.sanmill'),
),
@ -172,18 +172,20 @@ class _AboutPageState extends State<AboutPage> {
return AlertDialog(
title: Text(
S.of(context).appName,
style: AppTheme.versionDialogAppNameTextStyle,
style: TextStyle(color: AppTheme.dialogTitleColor),
),
content: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(S.of(context).version + ": $_version"),
AppTheme.sizedBox,
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
SizedBox(height: AppTheme.sizedBoxHeight),
Text(
S.of(context).copyright,
style: AppTheme.versionDialogCopyrightTextStyle,
style: TextStyle(
fontSize: AppTheme.copyrightFontSize,
),
),
],
),

View File

@ -127,7 +127,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
),
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).aisPlayStyle, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
@ -147,7 +147,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
),
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).playSounds, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
@ -160,7 +160,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
),
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).whoMovesFirst, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
@ -174,7 +174,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
),
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).automaticBehavior,
style: AppTheme.settingsHeaderStyle),
SettingsCard(
@ -188,7 +188,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
),
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).restore, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,

View File

@ -25,7 +25,7 @@ class _HelpScreenState extends State<HelpScreen> {
backgroundColor: Color(Config.darkBackgroundColor),
body: ListView(
children: <Widget>[
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Container(
padding: const EdgeInsets.only(
top: 48, left: 16, right: 16, bottom: 16),

View File

@ -212,7 +212,7 @@ class _PersonalizationSettingsPageState
),
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).color, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,

View File

@ -228,7 +228,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
*/
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).placing, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
@ -251,7 +251,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
),
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).moving, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,
@ -274,7 +274,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
),
],
),
AppTheme.sizedBox,
SizedBox(height: AppTheme.sizedBoxHeight),
Text(S.of(context).removing, style: AppTheme.settingsHeaderStyle),
SettingsCard(
context: context,

View File

@ -40,7 +40,8 @@ class SettingsListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListTile(
title: Text(titleString, style: AppTheme.switchListTileTitleStyle),
title: Text(titleString,
style: TextStyle(color: AppTheme.switchListTileTitleColor)),
subtitle: subtitleString == null
? null
: Text(

View File

@ -41,7 +41,8 @@ class SettingsSwitchListTile extends StatelessWidget {
value: value,
onChanged: onChanged,
activeColor: AppTheme.switchListTileActiveColor,
title: Text(titleString, style: AppTheme.switchListTileTitleStyle),
title: Text(titleString,
style: TextStyle(color: AppTheme.switchListTileTitleColor)),
subtitle: subtitleString == null
? null
: Text(