diff --git a/lib/themes/bright_theme.dart b/lib/themes/bright_theme.dart index 4e5437b64..87c553cd2 100644 --- a/lib/themes/bright_theme.dart +++ b/lib/themes/bright_theme.dart @@ -1,22 +1,25 @@ +import 'package:cake_wallet/themes/light_theme.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/palette.dart'; import 'package:flutter/material.dart'; -class BrightTheme extends ThemeBase { +class BrightTheme extends LightTheme { BrightTheme({required int raw}) : super(raw: raw); @override String get title => S.current.bright_theme; - @override ThemeType get type => ThemeType.bright; + @override + Color get primaryColor => Palette.moderateSlateBlue; + @override + Color get primaryTextColor => Palette.darkBlueCraiola; + @override + Color get containerColor => Palette.moderateLavender; - ThemeData theme = ThemeData( - fontFamily: 'Lato', - brightness: Brightness.light, - scaffoldBackgroundColor: Palette.pinkFlamingo, // second gradient color - primaryColor: Palette.redHat, // third gradient color + @override + ThemeData get themeData => super.themeData.copyWith( indicatorColor: Colors.white.withOpacity(0.5), // page indicator hoverColor: Colors.white, // amount hint text (receive page) dividerColor: Palette.paleBlue, @@ -263,13 +266,6 @@ class BrightTheme extends ThemeBase { color: Palette.moderateSlateBlue, // primary buttons decorationColor: Colors.white, // alert left button, backgroundColor: Palette.dullGray // keyboard bar color - ), - ), - cardColor: Palette.moderateSlateBlue // bottom button (action list) - ); - - @override - ThemeData get themeData => theme.copyWith( - colorScheme: theme.colorScheme - .copyWith(background: Colors.white, secondary: Palette.blueCraiola)); + ) + )); } diff --git a/lib/themes/dark_theme.dart b/lib/themes/dark_theme.dart index e8cfab633..c7dcc5636 100644 --- a/lib/themes/dark_theme.dart +++ b/lib/themes/dark_theme.dart @@ -8,16 +8,21 @@ class DarkTheme extends ThemeBase { @override String get title => S.current.dark_theme; - @override ThemeType get type => ThemeType.dark; + @override + Brightness get brightness => Brightness.dark; + @override + Color get backgroundColor => PaletteDark.backgroundColor; + @override + Color get primaryColor => Palette.blueCraiola; + @override + Color get primaryTextColor => Colors.white; + @override + Color get containerColor => PaletteDark.nightBlue; - ThemeData theme = ThemeData( - fontFamily: 'Lato', - brightness: Brightness.dark, - scaffoldBackgroundColor: - PaletteDark.backgroundColor, // second gradient color - primaryColor: PaletteDark.backgroundColor, // third gradient color + @override + ThemeData get themeData => super.themeData.copyWith( indicatorColor: PaletteDark.cyanBlue, // page indicator hoverColor: PaletteDark.cyanBlue, // amount hint text (receive page) dividerColor: PaletteDark.dividerColor, @@ -274,12 +279,5 @@ class DarkTheme extends ThemeBase { backgroundColor: PaletteDark.granite // keyboard bar color ), ), - cardColor: PaletteDark.darkNightBlue // bottom button (action list) ); - - @override - ThemeData get themeData => theme.copyWith( - colorScheme: theme.colorScheme.copyWith( - background: PaletteDark.backgroundColor, - secondary: PaletteDark.backgroundColor)); } diff --git a/lib/themes/light_theme.dart b/lib/themes/light_theme.dart index ad572c13f..e8a1741c0 100644 --- a/lib/themes/light_theme.dart +++ b/lib/themes/light_theme.dart @@ -8,15 +8,21 @@ class LightTheme extends ThemeBase { @override String get title => S.current.light_theme; - @override ThemeType get type => ThemeType.light; + @override + Brightness get brightness => Brightness.light; + @override + Color get backgroundColor => Colors.white; + @override + Color get primaryColor => Palette.protectiveBlue; + @override + Color get primaryTextColor => Palette.darkBlueCraiola; + @override + Color get containerColor => Palette.blueAlice; - ThemeData theme = ThemeData( - fontFamily: 'Lato', - brightness: Brightness.light, - scaffoldBackgroundColor: Colors.white, // second gradient color - primaryColor: Colors.white, // third gradient color + @override + ThemeData get themeData => super.themeData.copyWith( indicatorColor: PaletteDark.darkCyanBlue.withOpacity(0.67), // page indicator hoverColor: Palette.darkBlueCraiola, // amount hint text (receive page) @@ -265,11 +271,5 @@ class LightTheme extends ThemeBase { backgroundColor: Palette.dullGray // keyboard bar color ), ), - cardColor: Palette.protectiveBlue // bottom button (action list) ); - - @override - ThemeData get themeData => theme.copyWith( - colorScheme: theme.colorScheme - .copyWith(background: Colors.white, secondary: Colors.white)); } diff --git a/lib/themes/theme_base.dart b/lib/themes/theme_base.dart index 50406652a..ec92f6f36 100644 --- a/lib/themes/theme_base.dart +++ b/lib/themes/theme_base.dart @@ -1,17 +1,34 @@ import 'package:flutter/material.dart'; -enum ThemeType {light, bright, dark} +enum ThemeType { light, bright, dark } abstract class ThemeBase { ThemeBase({required this.raw}); final int raw; String get title; - ThemeData get themeData; ThemeType get type; @override String toString() { return title; } + + Brightness get brightness; + Color get backgroundColor; + Color get primaryColor; + Color get primaryTextColor; + Color get containerColor; + + ColorScheme get colorScheme => ColorScheme.fromSeed( + brightness: brightness, + seedColor: primaryColor, + background: backgroundColor); + + ThemeData get themeData => ThemeData.from( + colorScheme: colorScheme, + textTheme: TextTheme().apply(fontFamily: 'Lato')) + .copyWith( + primaryColor: primaryColor, + cardColor: containerColor); } \ No newline at end of file