diff --git a/src/ui/flutter_app/lib/style/app_theme.dart b/src/ui/flutter_app/lib/style/app_theme.dart index d1eba9df..4f0be260 100644 --- a/src/ui/flutter_app/lib/style/app_theme.dart +++ b/src/ui/flutter_app/lib/style/app_theme.dart @@ -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; } diff --git a/src/ui/flutter_app/lib/widgets/about_page.dart b/src/ui/flutter_app/lib/widgets/about_page.dart index 5af69f76..99bb3009 100644 --- a/src/ui/flutter_app/lib/widgets/about_page.dart +++ b/src/ui/flutter_app/lib/widgets/about_page.dart @@ -88,7 +88,7 @@ class _AboutPageState extends State { /* 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 { 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: [ 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, + ), ), ], ), 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 ffb1f64f..5004887b 100644 --- a/src/ui/flutter_app/lib/widgets/game_settings_page.dart +++ b/src/ui/flutter_app/lib/widgets/game_settings_page.dart @@ -127,7 +127,7 @@ class _GameSettingsPageState extends State { ), ], ), - 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 { ), ], ), - 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 { ), ], ), - 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 { ), ], ), - AppTheme.sizedBox, + SizedBox(height: AppTheme.sizedBoxHeight), Text(S.of(context).automaticBehavior, style: AppTheme.settingsHeaderStyle), SettingsCard( @@ -188,7 +188,7 @@ class _GameSettingsPageState extends State { ), ], ), - AppTheme.sizedBox, + SizedBox(height: AppTheme.sizedBoxHeight), Text(S.of(context).restore, style: AppTheme.settingsHeaderStyle), SettingsCard( context: context, diff --git a/src/ui/flutter_app/lib/widgets/help_screen.dart b/src/ui/flutter_app/lib/widgets/help_screen.dart index 91158585..7bd1f1bf 100644 --- a/src/ui/flutter_app/lib/widgets/help_screen.dart +++ b/src/ui/flutter_app/lib/widgets/help_screen.dart @@ -25,7 +25,7 @@ class _HelpScreenState extends State { backgroundColor: Color(Config.darkBackgroundColor), body: ListView( children: [ - AppTheme.sizedBox, + SizedBox(height: AppTheme.sizedBoxHeight), Container( padding: const EdgeInsets.only( top: 48, left: 16, right: 16, bottom: 16), diff --git a/src/ui/flutter_app/lib/widgets/personalization_settings_page.dart b/src/ui/flutter_app/lib/widgets/personalization_settings_page.dart index 6ac6435b..fcab91e6 100644 --- a/src/ui/flutter_app/lib/widgets/personalization_settings_page.dart +++ b/src/ui/flutter_app/lib/widgets/personalization_settings_page.dart @@ -212,7 +212,7 @@ class _PersonalizationSettingsPageState ), ], ), - AppTheme.sizedBox, + SizedBox(height: AppTheme.sizedBoxHeight), Text(S.of(context).color, style: AppTheme.settingsHeaderStyle), SettingsCard( context: context, 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 ff01e013..2933f7a6 100644 --- a/src/ui/flutter_app/lib/widgets/rule_settings_page.dart +++ b/src/ui/flutter_app/lib/widgets/rule_settings_page.dart @@ -228,7 +228,7 @@ class _RuleSettingsPageState extends State { */ ], ), - 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 { ), ], ), - 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 { ), ], ), - AppTheme.sizedBox, + SizedBox(height: AppTheme.sizedBoxHeight), Text(S.of(context).removing, style: AppTheme.settingsHeaderStyle), SettingsCard( context: context, diff --git a/src/ui/flutter_app/lib/widgets/settings_list_tile.dart b/src/ui/flutter_app/lib/widgets/settings_list_tile.dart index abfaf1a9..56693afc 100644 --- a/src/ui/flutter_app/lib/widgets/settings_list_tile.dart +++ b/src/ui/flutter_app/lib/widgets/settings_list_tile.dart @@ -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( diff --git a/src/ui/flutter_app/lib/widgets/settings_switch_list_tile.dart b/src/ui/flutter_app/lib/widgets/settings_switch_list_tile.dart index 41897928..25dbd0af 100644 --- a/src/ui/flutter_app/lib/widgets/settings_switch_list_tile.dart +++ b/src/ui/flutter_app/lib/widgets/settings_switch_list_tile.dart @@ -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(