flutter: Refactor color

This commit is contained in:
Calcitem 2021-04-03 23:58:58 +08:00
parent f82b18d975
commit dc41860063
17 changed files with 166 additions and 241 deletions

View File

@ -17,7 +17,7 @@
*/
import 'package:sanmill/mill/rule.dart';
import 'package:sanmill/style/colors.dart';
import 'package:sanmill/style/app_theme.dart';
import 'settings.dart';
@ -42,11 +42,11 @@ class Config {
static double boardInnerLineWidth = 2.0;
// Color
static int boardLineColor = UIColors.boardLineColor.value;
static int darkBackgroundColor = UIColors.darkBackgroundColor.value;
static int boardBackgroundColor = UIColors.boardBackgroundColor.value;
static int blackPieceColor = UIColors.blackPieceColor.value;
static int whitePieceColor = UIColors.whitePieceColor.value;
static int boardLineColor = AppTheme.boardLineColor.value;
static int darkBackgroundColor = AppTheme.darkBackgroundColor.value;
static int boardBackgroundColor = AppTheme.boardBackgroundColor.value;
static int blackPieceColor = AppTheme.blackPieceColor.value;
static int whitePieceColor = AppTheme.whitePieceColor.value;
// Rules
static int piecesCount = 9;
@ -87,15 +87,15 @@ class Config {
// Color
Config.boardLineColor =
settings['BoardLineColor'] ?? UIColors.boardLineColor.value;
settings['BoardLineColor'] ?? AppTheme.boardLineColor.value;
Config.darkBackgroundColor =
settings['DarkBackgroundColor'] ?? UIColors.darkBackgroundColor.value;
settings['DarkBackgroundColor'] ?? AppTheme.darkBackgroundColor.value;
Config.boardBackgroundColor =
settings['BoardBackgroundColor'] ?? UIColors.boardBackgroundColor.value;
settings['BoardBackgroundColor'] ?? AppTheme.boardBackgroundColor.value;
Config.blackPieceColor =
settings['BlackPieceColor'] ?? UIColors.blackPieceColor.value;
settings['BlackPieceColor'] ?? AppTheme.blackPieceColor.value;
Config.whitePieceColor =
settings['WhitePieceColor'] ?? UIColors.whitePieceColor.value;
settings['WhitePieceColor'] ?? AppTheme.whitePieceColor.value;
// Rules
rule.piecesCount = Config.piecesCount = settings['PiecesCount'] ?? 9;

View File

@ -25,7 +25,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:path_provider/path_provider.dart';
import 'package:sanmill/generated/l10n.dart';
import 'package:sanmill/style/colors.dart';
import 'package:sanmill/style/app_theme.dart';
import 'package:sanmill/widgets/navigation_home_screen.dart';
import 'package:stack_trace/stack_trace.dart';
@ -157,7 +157,7 @@ class _SanmillAppState extends State<SanmillApp> {
languageCode: 'zh'), // Chinese *See Advanced Locales below*
// ... other locales the app supports
],
theme: ThemeData(primarySwatch: UIColors.appBarColor),
theme: ThemeData(primarySwatch: AppTheme.appPrimaryColor),
debugShowCheckedModeBanner: false,
home: WillPopScope(
onWillPop: () async {

View File

@ -21,7 +21,6 @@ import 'package:sanmill/common/config.dart';
import 'package:sanmill/mill/game.dart';
import 'package:sanmill/mill/mill.dart';
import 'package:sanmill/mill/types.dart';
import 'package:sanmill/style/colors.dart';
import 'package:sanmill/style/app_theme.dart';
import 'painter_base.dart';
@ -74,7 +73,7 @@ class BoardPainter extends PiecesBasePainter {
TextSpan textSpan = TextSpan(
style:
TextStyle(fontSize: 48, color: UIColors.boardLineColor), // TODO
TextStyle(fontSize: 48, color: AppTheme.boardLineColor), // TODO
text: pieceInHandCountStr);
TextPainter textPainter = TextPainter(

View File

@ -20,7 +20,6 @@ import 'package:flutter/material.dart';
import 'package:sanmill/common/config.dart';
import 'package:sanmill/mill/mill.dart';
import 'package:sanmill/mill/position.dart';
import 'package:sanmill/style/colors.dart';
import 'package:sanmill/style/app_theme.dart';
import 'painter_base.dart';
@ -133,14 +132,14 @@ class PiecesPainter extends PiecesBasePainter {
// Draw Border of Piece
switch (pps.piece) {
case Piece.blackStone:
paint.color = UIColors.blackPieceBorderColor;
paint.color = AppTheme.blackPieceBorderColor;
canvas.drawCircle(pps.pos!, pieceRadius, paint); // For debugging
paint.color = Color(Config.blackPieceColor);
canvas.drawCircle(pps.pos!, pieceInnerRadius, paint);
blurPositionColor = Color(Config.blackPieceColor).withOpacity(0.1);
break;
case Piece.whiteStone:
paint.color = UIColors.whitePieceBorderColor;
paint.color = AppTheme.whitePieceBorderColor;
canvas.drawCircle(pps.pos!, pieceRadius, paint); // For debugging
paint.color = Color(Config.whitePieceColor);
canvas.drawCircle(pps.pos!, pieceInnerRadius, paint);

View File

@ -4,125 +4,99 @@ import 'package:sanmill/style/colors.dart';
class AppTheme {
AppTheme._();
static const Color notWhite = Color(0xFFEDF0F2);
static const Color nearlyWhite = Color(0xFFFEFEFE);
static const Color white = Color(0xFFFFFFFF);
static const Color nearlyBlack = Color(0xFF213333);
static const Color grey = Color(0xFF3A5160);
static const Color dark_grey = Color(0xFF313A44);
// Color
static const Color darkText = Color(0xFF253840);
static const Color darkerText = Color(0xFF17262A);
static const Color lightText = Color(0xFF4A6572);
static const Color deactivatedText = Color(0xFF767676);
static const Color dismissibleBackground = Color(0xFF364A54);
static const Color chipBackground = Color(0xFFEEF1F3);
static const Color spacer = Color(0xFFF2F2F2);
static const String fontName = 'WorkSans';
static var appPrimaryColor = Colors.green; // Appbar & Dialog button
static var dialogTitleColor = appPrimaryColor;
static const TextTheme textTheme = TextTheme(
headline4: display1,
headline5: headline,
headline6: title,
subtitle2: subtitle,
bodyText2: body2,
bodyText1: body1,
caption: caption,
);
/// Game page
static var gamePageHeaderIconColor = Colors.white;
static var tipTextColor = Colors.white;
static var boardBackgroundColor = UIColors.burlyWood;
static var boardLineColor = Color(0x996D000D);
static var blackPieceColor = Color.fromARGB(0xFF, 0x00, 0x00, 0x00);
static var blackPieceBorderColor = Color.fromARGB(0xFF, 0x22, 0x22, 0x22);
static var whitePieceColor = Color.fromARGB(0xFF, 0xFF, 0xFF, 0xFF);
static var whitePieceBorderColor = Color.fromARGB(0xFF, 0x66, 0x00, 0x00);
static var banColor = Color.fromARGB(0xFF, 0xFF, 0x00, 0x00); // unused
static var banBorderColor = Color.fromARGB(0x80, 0xFF, 0x00, 0x00); // unused
static var toolbarIconColor = listTileSubtitleColor;
static var toolbarTextColor = toolbarIconColor;
static var moveHistoryTextColor = Colors.yellow;
static var moveHistoryDialogBackgroundColor = Colors.transparent;
static var hintDialogackgroundColor = moveHistoryDialogBackgroundColor;
static var hintTextColor = moveHistoryTextColor;
static const TextStyle display1 = TextStyle(
// h4 -> display1
fontFamily: fontName,
fontWeight: FontWeight.bold,
fontSize: 36,
letterSpacing: 0.4,
height: 0.9,
color: darkerText,
);
/// Settings page
static var darkBackgroundColor = UIColors.crusoe;
static var lightBackgroundColor = UIColors.papayaWhip;
static var listTileSubtitleColor = Color(0x99461220);
static var listItemDividerColor = Color(0x336D000D);
static const TextStyle headline = TextStyle(
// h5 -> headline
fontFamily: fontName,
fontWeight: FontWeight.bold,
fontSize: 24,
letterSpacing: 0.27,
color: darkerText,
);
/// Help page
static var helpBackgroundColor = boardBackgroundColor;
static var helpTextColor = boardBackgroundColor;
static const TextStyle title = TextStyle(
// h6 -> title
fontFamily: fontName,
fontWeight: FontWeight.bold,
fontSize: 16,
letterSpacing: 0.18,
color: darkerText,
);
/// Drawer
static var drawerColor = Colors.white;
static var drawerBackgroundColor = UIColors.notWhite.withOpacity(0.5); // TODO
static var drawerHighlightItemColor =
drawerHighlightTextColor.withOpacity(0.2);
static var drawerDividerColor = UIColors.grey.withOpacity(0.6);
static var drawerBoxerShadowColor = UIColors.grey.withOpacity(0.6);
static var drawerTextColor = UIColors.nearlyBlack;
static var drawerHighlightTextColor = Colors.blue;
static var exitTextColor = UIColors.nearlyBlack;
static var drawerIconColor = drawerTextColor;
static var drawerHighlightIconColor = drawerHighlightTextColor;
static var drawerAnimationIconColor = Colors.white;
static var exitIconColor = Colors.red;
static var drawerSplashColor = Colors.grey.withOpacity(0.1); // TODO: no use?
static var drawerHightlightColor = Colors.transparent; // TODO: no use?
static var navigationHomeScreenBackgroundColor =
UIColors.nearlyWhite; // TODO: no use?
static const TextStyle subtitle = TextStyle(
// subtitle2 -> subtitle
fontFamily: fontName,
fontWeight: FontWeight.w400,
fontSize: 14,
letterSpacing: -0.04,
color: darkText,
);
static const animatedTextsColors = [
Colors.black,
Colors.blue,
Colors.yellow,
Colors.red,
];
static const TextStyle body2 = TextStyle(
// body1 -> body2
fontFamily: fontName,
fontWeight: FontWeight.w400,
fontSize: 14,
letterSpacing: 0.2,
color: darkText,
);
// Style
static const TextStyle body1 = TextStyle(
// body2 -> body1
fontFamily: fontName,
fontWeight: FontWeight.w400,
fontSize: 16,
letterSpacing: -0.05,
color: darkText,
);
static var gamePageTipStyle = TextStyle(fontSize: 16, color: tipTextColor);
static const TextStyle caption = TextStyle(
// Caption -> caption
fontFamily: fontName,
fontWeight: FontWeight.w400,
fontSize: 12,
letterSpacing: 0.2,
color: lightText, // was lightText
);
static const SizedBox sizedBox = SizedBox(height: 16);
static const cardColor = UIColors.floralWhiteColor;
static const cardColor = UIColors.floralWhite;
static const cardMargin =
const EdgeInsets.symmetric(vertical: 4.0, horizontal: 0);
static const settingsHeaderStyle =
TextStyle(color: UIColors.crusoeColor, fontSize: 20.0);
TextStyle(color: UIColors.crusoe, fontSize: 20.0);
static const switchListTileActiveColor = UIColors.primaryColor;
static const switchListTileTitleStyle =
TextStyle(color: UIColors.crusoeColor);
static var switchListTileActiveColor = dialogTitleColor;
static var switchListTileTitleStyle = TextStyle(color: UIColors.crusoe);
static const aboutPageBackgroundColor = UIColors.lightBackgroundColor;
static var moveHistoryTextStyle =
TextStyle(fontSize: 18, height: 1.5, color: moveHistoryTextColor);
static const double copyrightFontSize = 12;
static const versionDialogAppNameTextStyle =
TextStyle(color: UIColors.primaryColor);
static const versionDialogCopyrightTextStyle = TextStyle(
static var aboutPageBackgroundColor = lightBackgroundColor;
static double copyrightFontSize = 12;
static var versionDialogAppNameTextStyle = TextStyle(color: dialogTitleColor);
static var versionDialogCopyrightTextStyle = TextStyle(
fontSize: AppTheme.copyrightFontSize,
);
static const double boardBorderRadius = 5;
static const boardPadding = 5.0;
static double boardBorderRadius = 5;
static var boardPadding = 5.0;
static const double drawerWidth = 250;
static const double boardMargin = 10.0;
static const boardScreenPaddingH = 10.0;
static double boardMargin = 10.0;
static var boardScreenPaddingH = 10.0;
// Theme
static const sliderThemeData = SliderThemeData(
trackHeight: 20,
@ -144,4 +118,7 @@ class AppTheme {
tickMarkShape: RoundSliderTickMarkShape(tickMarkRadius: 2.0),
valueIndicatorTextStyle: TextStyle(fontSize: 24),
);
// Misc
static const SizedBox sizedBox = SizedBox(height: 16);
}

View File

@ -19,41 +19,19 @@
import 'package:flutter/material.dart';
class UIColors {
static const floralWhiteColor = Color(0xFFFFFAF0);
static const crusoeColor = Color(0xFF165B31);
static const burlyWoodColor = Color(0xFFDEB887);
static const papayaWhipColor = Color(0xFFFFEFD5);
static const forestGreenColor = Color(0xFF228B22);
static const turmericColor = Color.fromARGB(0xFF, 186, 202, 68);
static const white = Color(0xFFFFFFFF);
static const notWhite = Color(0xFFEDF0F2);
static const nearlyWhite = Color(0xFFFEFEFE);
static const floralWhite = Color(0xFFFFFAF0);
static const logoColor = Color(0xFF6D000D);
static const nearlyBlack = Color(0xFF213333);
static const primaryColor = Colors.green;
static const secondaryColor = Color(0x99461220);
static const grey = Color(0xFF3A5160);
static const darkGrey = Color(0xFF313A44);
static var darkBackgroundColor = crusoeColor;
static const lightBackgroundColor = papayaWhipColor;
static var appBarColor = UIColors.primaryColor;
static var boardBackgroundColor = burlyWoodColor;
static const darkTextPrimaryColor = Colors.white;
static const darkTextSecondaryColor = Colors.white;
static var boardLineColor = Color(0x996D000D);
static const boardTipsColor = Color(0x666D000D);
static const lightLineColor = Color(0x336D000D);
static const blackPieceColor = Color.fromARGB(0xFF, 0x00, 0x00, 0x00);
static const blackPieceBorderColor = Color.fromARGB(0xFF, 0x22, 0x22, 0x22);
static const whitePieceColor = Color.fromARGB(0xFF, 0xFF, 0xFF, 0xFF);
static const whitePieceBorderColor = Color.fromARGB(0xFF, 0x66, 0x00, 0x00);
static const banColor = Color.fromARGB(0xFF, 0xFF, 0x00, 0x00);
static const banBorderColor = Color.fromARGB(0x80, 0xFF, 0x00, 0x00);
static const pieceTextColor = Color.fromARGB(0xCC, 0xFF, 0xFF, 0xFF);
static const papayaWhip = Color(0xFFFFEFD5);
static const turmeric = Color.fromARGB(0xFF, 186, 202, 68);
static const burlyWood = Color(0xFFDEB887);
static const forestGreen = Color(0xFF228B22);
static const crusoe = Color(0xFF165B31);
}

View File

@ -106,7 +106,7 @@ class _DrawerUserControllerState extends State<DrawerUserController>
? widget.menuView
: AnimatedIcon(
icon: widget.animatedIconData,
color: Colors.white,
color: AppTheme.drawerAnimationIconColor,
progress: iconAnimationController),
),
onTap: () {
@ -186,9 +186,9 @@ class _DrawerUserControllerState extends State<DrawerUserController>
//full-screen Width with widget.screenView
child: Container(
decoration: BoxDecoration(
color: AppTheme.white,
color: AppTheme.drawerColor,
boxShadow: <BoxShadow>[
BoxShadow(color: AppTheme.grey.withOpacity(0.6), blurRadius: 24),
BoxShadow(color: AppTheme.drawerBoxerShadowColor, blurRadius: 24),
],
),
child: Stack(
@ -199,7 +199,7 @@ class _DrawerUserControllerState extends State<DrawerUserController>
];
return Scaffold(
backgroundColor: AppTheme.white,
backgroundColor: AppTheme.drawerColor,
body: SingleChildScrollView(
controller: scrollController,
scrollDirection: Axis.horizontal,

View File

@ -27,7 +27,6 @@ import 'package:sanmill/mill/game.dart';
import 'package:sanmill/mill/mill.dart';
import 'package:sanmill/mill/types.dart';
import 'package:sanmill/services/audios.dart';
import 'package:sanmill/style/colors.dart';
import 'package:stack_trace/stack_trace.dart';
import 'package:sanmill/style/app_theme.dart';
@ -292,7 +291,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
builder: (BuildContext context) {
return AlertDialog(
title: Text(S.of(context).newGame,
style: TextStyle(color: UIColors.primaryColor)),
style: TextStyle(color: AppTheme.dialogTitleColor)),
content:
SingleChildScrollView(child: Text(S.of(context).restartGame)),
actions: <Widget>[
@ -408,7 +407,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
builder: (BuildContext context) {
return AlertDialog(
title: Text(dialogTitle,
style: TextStyle(color: UIColors.primaryColor)),
style: TextStyle(color: AppTheme.dialogTitleColor)),
content: Text(getGameOverReasonString(
Game.instance.position.gameOverReason,
Game.instance.position.winner) +
@ -435,7 +434,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
builder: (BuildContext context) {
return AlertDialog(
title: Text(dialogTitle,
style: TextStyle(color: UIColors.primaryColor)),
style: TextStyle(color: AppTheme.dialogTitleColor)),
content: Text(getGameOverReasonString(
Game.instance.position.gameOverReason,
Game.instance.position.winner)),
@ -496,10 +495,7 @@ class _GamePageState extends State<GamePage> with RouteAware {
IconData iconArrow = getIconArrow();
final subTitleStyle =
TextStyle(fontSize: 16, color: UIColors.darkTextSecondaryColor);
var iconColor = UIColors.darkTextPrimaryColor;
var iconColor = AppTheme.gamePageHeaderIconColor;
var iconRow = Row(
children: <Widget>[
@ -527,7 +523,8 @@ class _GamePageState extends State<GamePage> with RouteAware {
),
Container(
padding: EdgeInsets.symmetric(horizontal: 16),
child: Text(_status!, maxLines: 1, style: subTitleStyle),
child:
Text(_status!, maxLines: 1, style: AppTheme.gamePageTipStyle),
),
],
),
@ -609,19 +606,16 @@ class _GamePageState extends State<GamePage> with RouteAware {
Game.instance.position.pieceOnBoardCount[PieceColor.white].toString() +
" pieces on board\n";
final manualStyle =
TextStyle(fontSize: 18, height: 1.5, color: Colors.yellow);
var newGameButton = TextButton(
child: Column(
// Replace with a Row for horizontal icon + text
children: <Widget>[
Icon(
Icons.motion_photos_on,
color: UIColors.secondaryColor,
color: AppTheme.toolbarIconColor,
),
Text(S.of(context).newGame,
style: TextStyle(color: UIColors.secondaryColor)),
style: TextStyle(color: AppTheme.toolbarTextColor)),
],
),
onPressed: newGame,
@ -633,10 +627,10 @@ class _GamePageState extends State<GamePage> with RouteAware {
children: <Widget>[
Icon(
Icons.restore,
color: UIColors.secondaryColor,
color: AppTheme.toolbarIconColor,
),
Text(S.of(context).regret,
style: TextStyle(color: UIColors.secondaryColor)),
style: TextStyle(color: AppTheme.toolbarTextColor)),
],
),
onPressed: () {
@ -651,10 +645,10 @@ class _GamePageState extends State<GamePage> with RouteAware {
children: <Widget>[
Icon(
Icons.list_alt,
color: UIColors.secondaryColor,
color: AppTheme.toolbarIconColor,
),
Text(S.of(context).gameRecord,
style: TextStyle(color: UIColors.secondaryColor)),
style: TextStyle(color: AppTheme.toolbarTextColor)),
],
),
onPressed: () => showDialog(
@ -662,14 +656,15 @@ class _GamePageState extends State<GamePage> with RouteAware {
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
backgroundColor: Colors.transparent,
backgroundColor: AppTheme.moveHistoryDialogBackgroundColor,
title: Text(S.of(context).gameRecord,
style: TextStyle(color: Colors.yellow)),
style: TextStyle(color: AppTheme.moveHistoryTextColor)),
content: SingleChildScrollView(
child: Text(manualText, style: manualStyle)),
child: Text(manualText, style: AppTheme.moveHistoryTextStyle)),
actions: <Widget>[
TextButton(
child: Text(S.of(context).copy, style: manualStyle),
child: Text(S.of(context).copy,
style: AppTheme.moveHistoryTextStyle),
onPressed: () =>
Clipboard.setData(ClipboardData(text: manualText))
.then((_) {
@ -677,7 +672,8 @@ class _GamePageState extends State<GamePage> with RouteAware {
}),
),
TextButton(
child: Text(S.of(context).cancel, style: manualStyle),
child: Text(S.of(context).cancel,
style: AppTheme.moveHistoryTextStyle),
onPressed: () => Navigator.of(context).pop(),
),
],
@ -692,10 +688,10 @@ class _GamePageState extends State<GamePage> with RouteAware {
children: <Widget>[
Icon(
Icons.lightbulb_outline,
color: UIColors.secondaryColor,
color: AppTheme.toolbarIconColor,
),
Text(S.of(context).hint,
style: TextStyle(color: UIColors.secondaryColor)),
style: TextStyle(color: AppTheme.toolbarTextColor)),
],
),
onPressed: () => showDialog(
@ -703,14 +699,15 @@ class _GamePageState extends State<GamePage> with RouteAware {
barrierDismissible: false,
builder: (BuildContext context) {
return AlertDialog(
backgroundColor: Colors.transparent,
backgroundColor: AppTheme.hintDialogackgroundColor,
title: Text(S.of(context).analyze,
style: TextStyle(color: Colors.yellow)),
style: TextStyle(color: AppTheme.hintTextColor)),
content: SingleChildScrollView(
child: Text(analyzeText, style: manualStyle)),
child: Text(analyzeText, style: AppTheme.moveHistoryTextStyle)),
actions: <Widget>[
TextButton(
child: Text(S.of(context).ok, style: manualStyle),
child: Text(S.of(context).ok,
style: AppTheme.moveHistoryTextStyle),
onPressed: () => Navigator.of(context).pop(),
),
],
@ -741,16 +738,11 @@ class _GamePageState extends State<GamePage> with RouteAware {
}
Widget buildMoveHistoryPanel(String text) {
final manualStyle = TextStyle(
fontSize: 18,
color: UIColors.darkTextSecondaryColor,
height: 1.5,
);
return Expanded(
child: Container(
margin: EdgeInsets.symmetric(vertical: 16),
child: SingleChildScrollView(child: Text(text, style: manualStyle)),
child: SingleChildScrollView(
child: Text(text, style: AppTheme.moveHistoryTextStyle)),
),
);
}

View File

@ -23,7 +23,6 @@ import 'package:sanmill/common/config.dart';
import 'package:sanmill/common/settings.dart';
import 'package:sanmill/generated/l10n.dart';
import 'package:sanmill/style/app_theme.dart';
import 'package:sanmill/style/colors.dart';
import 'package:sanmill/widgets/settings_card.dart';
import 'package:sanmill/widgets/settings_list_tile.dart';
import 'package:sanmill/widgets/settings_switch_list_tile.dart';
@ -82,7 +81,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
builder: (BuildContext context) {
return AlertDialog(
title: Text(S.of(context).restore,
style: TextStyle(color: UIColors.primaryColor)),
style: TextStyle(color: AppTheme.dialogTitleColor)),
content: SingleChildScrollView(
child: Text(S.of(context).restoreDefaultSettings +
"?\n" +
@ -100,7 +99,7 @@ class _GameSettingsPageState extends State<GameSettingsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: UIColors.lightBackgroundColor,
backgroundColor: AppTheme.lightBackgroundColor,
appBar: AppBar(
centerTitle: true,
title: Text(S.of(context).settings),

View File

@ -18,7 +18,7 @@ class _HelpScreenState extends State<HelpScreen> {
@override
Widget build(BuildContext context) {
return Container(
color: AppTheme.nearlyWhite,
color: UIColors.nearlyWhite,
child: SafeArea(
top: false,
child: Scaffold(
@ -34,7 +34,7 @@ class _HelpScreenState extends State<HelpScreen> {
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: UIColors.burlyWoodColor,
color: AppTheme.helpTextColor,
),
),
),
@ -46,7 +46,7 @@ class _HelpScreenState extends State<HelpScreen> {
textAlign: TextAlign.left,
style: TextStyle(
fontSize: 16,
color: UIColors.burlyWoodColor,
color: AppTheme.helpTextColor,
),
),
),

View File

@ -95,12 +95,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
Widget build(BuildContext context) {
setDrawerListArray();
const colorizeColors = [
Colors.black,
Colors.blue,
Colors.yellow,
Colors.red,
];
const colorizeColors = AppTheme.animatedTextsColors;
const colorizeTextStyle = TextStyle(
fontSize: 24.0,
@ -142,7 +137,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
);
return Scaffold(
backgroundColor: AppTheme.notWhite.withOpacity(0.5),
backgroundColor: AppTheme.drawerBackgroundColor,
body: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisAlignment: MainAxisAlignment.start,
@ -170,7 +165,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
),
Divider(
height: 1,
color: AppTheme.grey.withOpacity(0.6),
color: AppTheme.drawerDividerColor,
),
Expanded(
child: ListView.builder(
@ -184,7 +179,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
),
Divider(
height: 1,
color: AppTheme.grey.withOpacity(0.6),
color: AppTheme.drawerDividerColor,
),
Column(
children: <Widget>[
@ -192,16 +187,15 @@ class _HomeDrawerState extends State<HomeDrawer> {
title: Text(
S.of(context).exit,
style: TextStyle(
fontFamily: AppTheme.fontName,
fontWeight: FontWeight.w600,
fontSize: 16,
color: AppTheme.darkText,
color: AppTheme.exitTextColor,
),
textAlign: TextAlign.left,
),
trailing: Icon(
Icons.power_settings_new,
color: Colors.red,
color: AppTheme.exitIconColor,
),
onTap: () async {
await SystemChannels.platform
@ -234,7 +228,7 @@ class _HomeDrawerState extends State<HomeDrawer> {
width: MediaQuery.of(context).size.width * 0.75 - 64,
height: 46,
decoration: BoxDecoration(
color: Colors.blue.withOpacity(0.2),
color: AppTheme.drawerHighlightItemColor,
borderRadius: new BorderRadius.only(
topLeft: Radius.circular(0),
topRight: Radius.circular(28),
@ -254,44 +248,33 @@ class _HomeDrawerState extends State<HomeDrawer> {
fontWeight: FontWeight.w500,
fontSize: 16,
color: widget.screenIndex == listData.index
? Colors.blue
: AppTheme.nearlyBlack,
? AppTheme.drawerHighlightTextColor
: AppTheme.drawerTextColor,
),
textAlign: TextAlign.left,
);
var listDataIcon = Icon(listData.icon!.icon,
color: widget.screenIndex == listData.index
? Colors.blue
: AppTheme.nearlyBlack);
? AppTheme.drawerHighlightIconColor
: AppTheme.drawerIconColor);
var children3 = <Widget>[
Container(
width: 6.0,
height: 46.0,
// decoration: BoxDecoration(
// color: widget.screenIndex == listData.index
// ? Colors.blue
// : Colors.transparent,
// borderRadius: new BorderRadius.only(
// topLeft: Radius.circular(0),
// topRight: Radius.circular(16),
// bottomLeft: Radius.circular(0),
// bottomRight: Radius.circular(16),
// ),
// ),
),
const Padding(
padding: EdgeInsets.all(4.0),
),
listData.isAssetsImage
listData.isAssetsImage // TODO
? Container(
width: 24,
height: 24,
child: Image.asset(listData.imageName,
color: widget.screenIndex == listData.index
? Colors.blue
: AppTheme.nearlyBlack),
? AppTheme.drawerHighlightIconColor
: AppTheme.drawerIconColor),
)
: listDataIcon,
const Padding(
@ -313,8 +296,8 @@ class _HomeDrawerState extends State<HomeDrawer> {
return Material(
color: Colors.transparent,
child: InkWell(
splashColor: Colors.grey.withOpacity(0.1),
highlightColor: Colors.transparent,
splashColor: AppTheme.drawerSplashColor,
highlightColor: AppTheme.drawerHightlightColor,
onTap: () {
navigationToScreen(listData.index);
},

View File

@ -17,7 +17,7 @@
*/
import 'package:flutter/material.dart';
import 'package:sanmill/style/colors.dart';
import 'package:sanmill/style/app_theme.dart';
class ListItemDivider extends StatelessWidget {
const ListItemDivider({
@ -30,7 +30,7 @@ class ListItemDivider extends StatelessWidget {
margin: const EdgeInsets.symmetric(horizontal: 16),
width: double.infinity,
height: 1.0,
color: UIColors.lightLineColor,
color: AppTheme.listItemDividerColor,
);
}
}

View File

@ -6,6 +6,7 @@ import 'package:sanmill/widgets/about_page.dart';
import 'package:sanmill/widgets/drawer_user_controller.dart';
import 'package:sanmill/widgets/help_screen.dart';
import 'package:sanmill/widgets/home_drawer.dart';
import 'package:sanmill/style/colors.dart';
import 'game_page.dart';
import 'game_settings_page.dart';
@ -31,12 +32,12 @@ class _NavigationHomeScreenState extends State<NavigationHomeScreen> {
@override
Widget build(BuildContext context) {
return Container(
color: AppTheme.nearlyWhite,
color: UIColors.nearlyWhite,
child: SafeArea(
top: false,
bottom: false,
child: Scaffold(
backgroundColor: AppTheme.nearlyWhite,
backgroundColor: AppTheme.navigationHomeScreenBackgroundColor,
body: DrawerUserController(
screenIndex: drawerIndex,
drawerWidth: MediaQuery.of(context).size.width * 0.75,

View File

@ -21,7 +21,6 @@ import 'package:flutter_colorpicker/flutter_colorpicker.dart';
import 'package:sanmill/common/config.dart';
import 'package:sanmill/generated/l10n.dart';
import 'package:sanmill/style/app_theme.dart';
import 'package:sanmill/style/colors.dart';
import 'package:sanmill/widgets/settings_card.dart';
import 'package:sanmill/widgets/settings_list_tile.dart';
import 'package:sanmill/widgets/settings_switch_list_tile.dart';
@ -173,7 +172,7 @@ class _PersonalizationSettingsPageState
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: UIColors.lightBackgroundColor,
backgroundColor: AppTheme.lightBackgroundColor,
appBar: AppBar(
centerTitle: true,
title: Text(S.of(context).personalization),

View File

@ -21,7 +21,6 @@ import 'package:sanmill/common/config.dart';
import 'package:sanmill/generated/l10n.dart';
import 'package:sanmill/mill/rule.dart';
import 'package:sanmill/style/app_theme.dart';
import 'package:sanmill/style/colors.dart';
import 'package:sanmill/widgets/settings_card.dart';
import 'package:sanmill/widgets/settings_list_tile.dart';
import 'package:sanmill/widgets/settings_switch_list_tile.dart';
@ -171,7 +170,7 @@ class _RuleSettingsPageState extends State<RuleSettingsPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: UIColors.lightBackgroundColor,
backgroundColor: AppTheme.lightBackgroundColor,
appBar:
AppBar(centerTitle: true, title: Text(S.of(context).ruleSettings)),
body: SingleChildScrollView(

View File

@ -18,7 +18,6 @@
import 'package:flutter/material.dart';
import 'package:sanmill/style/app_theme.dart';
import 'package:sanmill/style/colors.dart';
class SettingsListTile extends StatelessWidget {
const SettingsListTile({
@ -46,7 +45,7 @@ class SettingsListTile extends StatelessWidget {
? null
: Text(
subtitleString!,
style: TextStyle(color: UIColors.secondaryColor),
style: TextStyle(color: AppTheme.listTileSubtitleColor),
),
trailing: Row(
mainAxisSize: MainAxisSize.min,
@ -60,7 +59,8 @@ class SettingsListTile extends StatelessWidget {
trailingColor == null ? null : Color(trailingColor!),
),
),
Icon(Icons.keyboard_arrow_right, color: UIColors.secondaryColor),
Icon(Icons.keyboard_arrow_right,
color: AppTheme.listTileSubtitleColor),
],
),
onTap: onTap,

View File

@ -18,7 +18,6 @@
import 'package:flutter/material.dart';
import 'package:sanmill/style/app_theme.dart';
import 'package:sanmill/style/colors.dart';
class SettingsSwitchListTile extends StatelessWidget {
const SettingsSwitchListTile({
@ -47,7 +46,7 @@ class SettingsSwitchListTile extends StatelessWidget {
? null
: Text(
subtitleString!,
style: TextStyle(color: UIColors.secondaryColor),
style: TextStyle(color: AppTheme.listTileSubtitleColor),
),
);
}