From b8be066acb38b24d86eafa57eae908d7d916b559 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 24 Jan 2023 12:42:41 -0600 Subject: [PATCH] add per theme box shadow and per theme homeview button bar shadow --- lib/pages/home_view/home_view.dart | 15 ++++++++++----- lib/utilities/theme/color_theme.dart | 3 +++ lib/utilities/theme/dark_colors.dart | 14 ++++++++++++++ lib/utilities/theme/fruit_sorbet_colors.dart | 10 ++++++++++ lib/utilities/theme/light_colors.dart | 14 ++++++++++++++ lib/utilities/theme/ocean_breeze_colors.dart | 14 ++++++++++++++ lib/utilities/theme/oled_black_colors.dart | 14 ++++++++++++++ lib/utilities/theme/stack_colors.dart | 20 ++++++++++++++------ 8 files changed, 93 insertions(+), 11 deletions(-) diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index 7d394d7ce..49317193e 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -275,11 +275,16 @@ class _HomeViewState extends ConsumerState { color: Theme.of(context) .extension()! .backgroundAppBar, - boxShadow: [ - Theme.of(context) - .extension()! - .standardBoxShadow, - ], + boxShadow: Theme.of(context) + .extension()! + .homeViewButtonBarBoxShadow != + null + ? [ + Theme.of(context) + .extension()! + .homeViewButtonBarBoxShadow!, + ] + : null, ), child: const Padding( padding: EdgeInsets.only( diff --git a/lib/utilities/theme/color_theme.dart b/lib/utilities/theme/color_theme.dart index d21b8a262..1d2772815 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -217,6 +217,9 @@ abstract class StackColorTheme { Color get myStackContactIconBG; Color get textConfirmTotalAmount; Color get textSelectedWordTableItem; + + BoxShadow get standardBoxShadow; + BoxShadow? get homeViewButtonBarBoxShadow; } class CoinThemeColor { diff --git a/lib/utilities/theme/dark_colors.dart b/lib/utilities/theme/dark_colors.dart index 9e3a625c1..b5938066c 100644 --- a/lib/utilities/theme/dark_colors.dart +++ b/lib/utilities/theme/dark_colors.dart @@ -314,4 +314,18 @@ class DarkColors extends StackColorTheme { Color get textConfirmTotalAmount => const Color(0xFF003921); @override Color get textSelectedWordTableItem => const Color(0xFF00297A); + + @override + BoxShadow get standardBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); + + @override + BoxShadow? get homeViewButtonBarBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); } diff --git a/lib/utilities/theme/fruit_sorbet_colors.dart b/lib/utilities/theme/fruit_sorbet_colors.dart index 0b6122723..6853c9bca 100644 --- a/lib/utilities/theme/fruit_sorbet_colors.dart +++ b/lib/utilities/theme/fruit_sorbet_colors.dart @@ -314,4 +314,14 @@ class FruitSorbetColors extends StackColorTheme { Color get textConfirmTotalAmount => const Color(0xFF232323); @override Color get textSelectedWordTableItem => const Color(0xFF232323); + + @override + BoxShadow get standardBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); + + @override + BoxShadow? get homeViewButtonBarBoxShadow => null; } diff --git a/lib/utilities/theme/light_colors.dart b/lib/utilities/theme/light_colors.dart index ef59ed622..57c02fc3c 100644 --- a/lib/utilities/theme/light_colors.dart +++ b/lib/utilities/theme/light_colors.dart @@ -314,4 +314,18 @@ class LightColors extends StackColorTheme { Color get textConfirmTotalAmount => const Color(0xFF232323); @override Color get textSelectedWordTableItem => const Color(0xFF232323); + + @override + BoxShadow get standardBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); + + @override + BoxShadow? get homeViewButtonBarBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); } diff --git a/lib/utilities/theme/ocean_breeze_colors.dart b/lib/utilities/theme/ocean_breeze_colors.dart index 8bc9dab52..4efa85d49 100644 --- a/lib/utilities/theme/ocean_breeze_colors.dart +++ b/lib/utilities/theme/ocean_breeze_colors.dart @@ -321,4 +321,18 @@ class OceanBreezeColors extends StackColorTheme { Color get textConfirmTotalAmount => const Color(0xFF232323); @override Color get textSelectedWordTableItem => const Color(0xFF232323); + + @override + BoxShadow get standardBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); + + @override + BoxShadow? get homeViewButtonBarBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); } diff --git a/lib/utilities/theme/oled_black_colors.dart b/lib/utilities/theme/oled_black_colors.dart index 5a878d7c6..e012f2c78 100644 --- a/lib/utilities/theme/oled_black_colors.dart +++ b/lib/utilities/theme/oled_black_colors.dart @@ -316,4 +316,18 @@ class OledBlackColors extends StackColorTheme { Color get textConfirmTotalAmount => const Color(0xFF144D35); @override Color get textSelectedWordTableItem => const Color(0xFF143D8E); + + @override + BoxShadow get standardBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); + + @override + BoxShadow? get homeViewButtonBarBoxShadow => BoxShadow( + color: shadow, + spreadRadius: 3, + blurRadius: 4, + ); } diff --git a/lib/utilities/theme/stack_colors.dart b/lib/utilities/theme/stack_colors.dart index b47e93128..9b0de36f5 100644 --- a/lib/utilities/theme/stack_colors.dart +++ b/lib/utilities/theme/stack_colors.dart @@ -176,6 +176,9 @@ class StackColors extends ThemeExtension { final Color textConfirmTotalAmount; final Color textSelectedWordTableItem; + final BoxShadow standardBoxShadow; + final BoxShadow? homeViewButtonBarBoxShadow; + StackColors({ required this.themeType, required this.background, @@ -312,6 +315,8 @@ class StackColors extends ThemeExtension { required this.myStackContactIconBG, required this.textConfirmTotalAmount, required this.textSelectedWordTableItem, + required this.standardBoxShadow, + required this.homeViewButtonBarBoxShadow, }); factory StackColors.fromStackColorTheme(StackColorTheme colorTheme) { @@ -453,6 +458,8 @@ class StackColors extends ThemeExtension { myStackContactIconBG: colorTheme.myStackContactIconBG, textConfirmTotalAmount: colorTheme.textConfirmTotalAmount, textSelectedWordTableItem: colorTheme.textSelectedWordTableItem, + homeViewButtonBarBoxShadow: colorTheme.homeViewButtonBarBoxShadow, + standardBoxShadow: colorTheme.standardBoxShadow, ); } @@ -593,6 +600,8 @@ class StackColors extends ThemeExtension { Color? myStackContactIconBG, Color? textConfirmTotalAmount, Color? textSelectedWordTableItem, + BoxShadow? homeViewButtonBarBoxShadow, + BoxShadow? standardBoxShadow, }) { return StackColors( themeType: themeType ?? this.themeType, @@ -768,6 +777,9 @@ class StackColors extends ThemeExtension { textConfirmTotalAmount ?? this.textConfirmTotalAmount, textSelectedWordTableItem: textSelectedWordTableItem ?? this.textSelectedWordTableItem, + homeViewButtonBarBoxShadow: + homeViewButtonBarBoxShadow ?? this.homeViewButtonBarBoxShadow, + standardBoxShadow: standardBoxShadow ?? this.standardBoxShadow, ); } @@ -783,6 +795,8 @@ class StackColors extends ThemeExtension { return StackColors( themeType: other.themeType, gradientBackground: other.gradientBackground, + homeViewButtonBarBoxShadow: other.homeViewButtonBarBoxShadow, + standardBoxShadow: other.standardBoxShadow, background: Color.lerp( background, other.background, @@ -1481,12 +1495,6 @@ class StackColors extends ThemeExtension { static const _coin = CoinThemeColor(); - BoxShadow get standardBoxShadow => BoxShadow( - color: shadow, - spreadRadius: 3, - blurRadius: 4, - ); - Color colorForStatus(String status) { switch (status) { case "New":