diff --git a/lib/pages/exchange_view/sub_widgets/rate_type_toggle.dart b/lib/pages/exchange_view/sub_widgets/rate_type_toggle.dart index 284d4eddd..8c82bbbc4 100644 --- a/lib/pages/exchange_view/sub_widgets/rate_type_toggle.dart +++ b/lib/pages/exchange_view/sub_widgets/rate_type_toggle.dart @@ -3,12 +3,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; +import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/toggle.dart'; -import '../../../utilities/constants.dart'; - class RateTypeToggle extends ConsumerWidget { const RateTypeToggle({ Key? key, @@ -37,10 +36,16 @@ class RateTypeToggle extends ConsumerWidget { } }, isOn: !estimated, - onColor: Theme.of(context).extension()!.textFieldDefaultBG, + onColor: isDesktop + ? Theme.of(context) + .extension()! + .rateTypeToggleDesktopColorOn + : Theme.of(context).extension()!.rateTypeToggleColorOn, offColor: isDesktop - ? Theme.of(context).extension()!.buttonBackSecondary - : Theme.of(context).extension()!.popupBG, + ? Theme.of(context) + .extension()! + .rateTypeToggleDesktopColorOff + : Theme.of(context).extension()!.rateTypeToggleColorOff, decoration: BoxDecoration( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, diff --git a/lib/utilities/theme/color_theme.dart b/lib/utilities/theme/color_theme.dart index 2eea34806..dfd62a6a0 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -220,9 +220,16 @@ abstract class StackColorTheme { Color get textConfirmTotalAmount; Color get textSelectedWordTableItem; +// rate type toggle + Color get rateTypeToggleColorOn; + Color get rateTypeToggleColorOff; + Color get rateTypeToggleDesktopColorOn; + Color get rateTypeToggleDesktopColorOff; + BoxShadow get standardBoxShadow; BoxShadow? get homeViewButtonBarBoxShadow; } +// 0xFFFFD8CE class CoinThemeColor { const CoinThemeColor(); diff --git a/lib/utilities/theme/dark_colors.dart b/lib/utilities/theme/dark_colors.dart index 298d8c86d..0ef106d65 100644 --- a/lib/utilities/theme/dark_colors.dart +++ b/lib/utilities/theme/dark_colors.dart @@ -319,6 +319,16 @@ class DarkColors extends StackColorTheme { @override Color get textSelectedWordTableItem => const Color(0xFF00297A); + //rate type toggle + @override + Color get rateTypeToggleColorOn => textFieldDefaultBG; + @override + Color get rateTypeToggleColorOff => popupBG; + @override + Color get rateTypeToggleDesktopColorOn => buttonBackSecondary; + @override + Color get rateTypeToggleDesktopColorOff => buttonBackSecondary; + @override BoxShadow get standardBoxShadow => BoxShadow( color: shadow, diff --git a/lib/utilities/theme/fruit_sorbet_colors.dart b/lib/utilities/theme/fruit_sorbet_colors.dart index 12ae33e7b..4d2a4be95 100644 --- a/lib/utilities/theme/fruit_sorbet_colors.dart +++ b/lib/utilities/theme/fruit_sorbet_colors.dart @@ -319,6 +319,16 @@ class FruitSorbetColors extends StackColorTheme { @override Color get textSelectedWordTableItem => const Color(0xFF232323); + //rate type toggle + @override + Color get rateTypeToggleColorOn => const Color(0xFFFFD8CE); + @override + Color get rateTypeToggleColorOff => popupBG; + @override + Color get rateTypeToggleDesktopColorOn => buttonBackSecondary; + @override + Color get rateTypeToggleDesktopColorOff => buttonBackSecondary; + @override BoxShadow get standardBoxShadow => BoxShadow( color: shadow, diff --git a/lib/utilities/theme/light_colors.dart b/lib/utilities/theme/light_colors.dart index fc825747c..ac5aac2cf 100644 --- a/lib/utilities/theme/light_colors.dart +++ b/lib/utilities/theme/light_colors.dart @@ -319,6 +319,16 @@ class LightColors extends StackColorTheme { @override Color get textSelectedWordTableItem => const Color(0xFF232323); + //rate type toggle + @override + Color get rateTypeToggleColorOn => textFieldDefaultBG; + @override + Color get rateTypeToggleColorOff => popupBG; + @override + Color get rateTypeToggleDesktopColorOn => buttonBackSecondary; + @override + Color get rateTypeToggleDesktopColorOff => buttonBackSecondary; + @override BoxShadow get standardBoxShadow => BoxShadow( color: shadow, diff --git a/lib/utilities/theme/ocean_breeze_colors.dart b/lib/utilities/theme/ocean_breeze_colors.dart index e907fd2cf..5d0ee3d26 100644 --- a/lib/utilities/theme/ocean_breeze_colors.dart +++ b/lib/utilities/theme/ocean_breeze_colors.dart @@ -326,6 +326,16 @@ class OceanBreezeColors extends StackColorTheme { @override Color get textSelectedWordTableItem => const Color(0xFF232323); + //rate type toggle + @override + Color get rateTypeToggleColorOn => textFieldDefaultBG; + @override + Color get rateTypeToggleColorOff => popupBG; + @override + Color get rateTypeToggleDesktopColorOn => buttonBackSecondary; + @override + Color get rateTypeToggleDesktopColorOff => buttonBackSecondary; + @override BoxShadow get standardBoxShadow => BoxShadow( color: shadow, diff --git a/lib/utilities/theme/oled_black_colors.dart b/lib/utilities/theme/oled_black_colors.dart index dbacb0914..a69902041 100644 --- a/lib/utilities/theme/oled_black_colors.dart +++ b/lib/utilities/theme/oled_black_colors.dart @@ -321,6 +321,16 @@ class OledBlackColors extends StackColorTheme { @override Color get textSelectedWordTableItem => const Color(0xFF143D8E); + //rate type toggle + @override + Color get rateTypeToggleColorOn => textFieldDefaultBG; + @override + Color get rateTypeToggleColorOff => popupBG; + @override + Color get rateTypeToggleDesktopColorOn => buttonBackSecondary; + @override + Color get rateTypeToggleDesktopColorOff => buttonBackSecondary; + @override BoxShadow get standardBoxShadow => BoxShadow( color: shadow, diff --git a/lib/utilities/theme/stack_colors.dart b/lib/utilities/theme/stack_colors.dart index 563dd621c..e9280fee5 100644 --- a/lib/utilities/theme/stack_colors.dart +++ b/lib/utilities/theme/stack_colors.dart @@ -178,6 +178,12 @@ class StackColors extends ThemeExtension { final Color textConfirmTotalAmount; final Color textSelectedWordTableItem; +// rate type toggle + final Color rateTypeToggleColorOn; + final Color rateTypeToggleColorOff; + final Color rateTypeToggleDesktopColorOn; + final Color rateTypeToggleDesktopColorOff; + final BoxShadow standardBoxShadow; final BoxShadow? homeViewButtonBarBoxShadow; @@ -319,6 +325,10 @@ class StackColors extends ThemeExtension { required this.myStackContactIconBG, required this.textConfirmTotalAmount, required this.textSelectedWordTableItem, + required this.rateTypeToggleColorOn, + required this.rateTypeToggleColorOff, + required this.rateTypeToggleDesktopColorOn, + required this.rateTypeToggleDesktopColorOff, required this.standardBoxShadow, required this.homeViewButtonBarBoxShadow, }); @@ -465,6 +475,10 @@ class StackColors extends ThemeExtension { myStackContactIconBG: colorTheme.myStackContactIconBG, textConfirmTotalAmount: colorTheme.textConfirmTotalAmount, textSelectedWordTableItem: colorTheme.textSelectedWordTableItem, + rateTypeToggleColorOn: colorTheme.rateTypeToggleColorOn, + rateTypeToggleColorOff: colorTheme.rateTypeToggleColorOff, + rateTypeToggleDesktopColorOn: colorTheme.rateTypeToggleDesktopColorOn, + rateTypeToggleDesktopColorOff: colorTheme.rateTypeToggleDesktopColorOff, homeViewButtonBarBoxShadow: colorTheme.homeViewButtonBarBoxShadow, standardBoxShadow: colorTheme.standardBoxShadow, ); @@ -609,6 +623,10 @@ class StackColors extends ThemeExtension { Color? myStackContactIconBG, Color? textConfirmTotalAmount, Color? textSelectedWordTableItem, + Color? rateTypeToggleColorOn, + Color? rateTypeToggleColorOff, + Color? rateTypeToggleDesktopColorOn, + Color? rateTypeToggleDesktopColorOff, BoxShadow? homeViewButtonBarBoxShadow, BoxShadow? standardBoxShadow, }) { @@ -790,6 +808,14 @@ class StackColors extends ThemeExtension { textConfirmTotalAmount ?? this.textConfirmTotalAmount, textSelectedWordTableItem: textSelectedWordTableItem ?? this.textSelectedWordTableItem, + rateTypeToggleColorOn: + rateTypeToggleColorOn ?? this.rateTypeToggleColorOn, + rateTypeToggleColorOff: + rateTypeToggleColorOff ?? this.rateTypeToggleColorOff, + rateTypeToggleDesktopColorOn: + rateTypeToggleDesktopColorOn ?? this.rateTypeToggleDesktopColorOn, + rateTypeToggleDesktopColorOff: + rateTypeToggleDesktopColorOff ?? this.rateTypeToggleDesktopColorOff, homeViewButtonBarBoxShadow: homeViewButtonBarBoxShadow ?? this.homeViewButtonBarBoxShadow, standardBoxShadow: standardBoxShadow ?? this.standardBoxShadow, @@ -1483,6 +1509,26 @@ class StackColors extends ThemeExtension { other.textSelectedWordTableItem, t, )!, + rateTypeToggleColorOn: Color.lerp( + rateTypeToggleColorOn, + other.rateTypeToggleColorOn, + t, + )!, + rateTypeToggleColorOff: Color.lerp( + rateTypeToggleColorOff, + other.rateTypeToggleColorOff, + t, + )!, + rateTypeToggleDesktopColorOn: Color.lerp( + rateTypeToggleDesktopColorOn, + other.rateTypeToggleDesktopColorOn, + t, + )!, + rateTypeToggleDesktopColorOff: Color.lerp( + rateTypeToggleDesktopColorOff, + other.rateTypeToggleDesktopColorOff, + t, + )!, ); }