mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-23 19:05:51 +00:00
exchange rate toggle color added
This commit is contained in:
parent
3dc98b6af6
commit
9815349efa
8 changed files with 113 additions and 5 deletions
|
@ -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/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/utilities/assets.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/theme/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/widgets/toggle.dart';
|
import 'package:stackwallet/widgets/toggle.dart';
|
||||||
|
|
||||||
import '../../../utilities/constants.dart';
|
|
||||||
|
|
||||||
class RateTypeToggle extends ConsumerWidget {
|
class RateTypeToggle extends ConsumerWidget {
|
||||||
const RateTypeToggle({
|
const RateTypeToggle({
|
||||||
Key? key,
|
Key? key,
|
||||||
|
@ -37,10 +36,16 @@ class RateTypeToggle extends ConsumerWidget {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isOn: !estimated,
|
isOn: !estimated,
|
||||||
onColor: Theme.of(context).extension<StackColors>()!.textFieldDefaultBG,
|
onColor: isDesktop
|
||||||
|
? Theme.of(context)
|
||||||
|
.extension<StackColors>()!
|
||||||
|
.rateTypeToggleDesktopColorOn
|
||||||
|
: Theme.of(context).extension<StackColors>()!.rateTypeToggleColorOn,
|
||||||
offColor: isDesktop
|
offColor: isDesktop
|
||||||
? Theme.of(context).extension<StackColors>()!.buttonBackSecondary
|
? Theme.of(context)
|
||||||
: Theme.of(context).extension<StackColors>()!.popupBG,
|
.extension<StackColors>()!
|
||||||
|
.rateTypeToggleDesktopColorOff
|
||||||
|
: Theme.of(context).extension<StackColors>()!.rateTypeToggleColorOff,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(
|
borderRadius: BorderRadius.circular(
|
||||||
Constants.size.circularBorderRadius,
|
Constants.size.circularBorderRadius,
|
||||||
|
|
|
@ -220,9 +220,16 @@ abstract class StackColorTheme {
|
||||||
Color get textConfirmTotalAmount;
|
Color get textConfirmTotalAmount;
|
||||||
Color get textSelectedWordTableItem;
|
Color get textSelectedWordTableItem;
|
||||||
|
|
||||||
|
// rate type toggle
|
||||||
|
Color get rateTypeToggleColorOn;
|
||||||
|
Color get rateTypeToggleColorOff;
|
||||||
|
Color get rateTypeToggleDesktopColorOn;
|
||||||
|
Color get rateTypeToggleDesktopColorOff;
|
||||||
|
|
||||||
BoxShadow get standardBoxShadow;
|
BoxShadow get standardBoxShadow;
|
||||||
BoxShadow? get homeViewButtonBarBoxShadow;
|
BoxShadow? get homeViewButtonBarBoxShadow;
|
||||||
}
|
}
|
||||||
|
// 0xFFFFD8CE
|
||||||
|
|
||||||
class CoinThemeColor {
|
class CoinThemeColor {
|
||||||
const CoinThemeColor();
|
const CoinThemeColor();
|
||||||
|
|
|
@ -319,6 +319,16 @@ class DarkColors extends StackColorTheme {
|
||||||
@override
|
@override
|
||||||
Color get textSelectedWordTableItem => const Color(0xFF00297A);
|
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
|
@override
|
||||||
BoxShadow get standardBoxShadow => BoxShadow(
|
BoxShadow get standardBoxShadow => BoxShadow(
|
||||||
color: shadow,
|
color: shadow,
|
||||||
|
|
|
@ -319,6 +319,16 @@ class FruitSorbetColors extends StackColorTheme {
|
||||||
@override
|
@override
|
||||||
Color get textSelectedWordTableItem => const Color(0xFF232323);
|
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
|
@override
|
||||||
BoxShadow get standardBoxShadow => BoxShadow(
|
BoxShadow get standardBoxShadow => BoxShadow(
|
||||||
color: shadow,
|
color: shadow,
|
||||||
|
|
|
@ -319,6 +319,16 @@ class LightColors extends StackColorTheme {
|
||||||
@override
|
@override
|
||||||
Color get textSelectedWordTableItem => const Color(0xFF232323);
|
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
|
@override
|
||||||
BoxShadow get standardBoxShadow => BoxShadow(
|
BoxShadow get standardBoxShadow => BoxShadow(
|
||||||
color: shadow,
|
color: shadow,
|
||||||
|
|
|
@ -326,6 +326,16 @@ class OceanBreezeColors extends StackColorTheme {
|
||||||
@override
|
@override
|
||||||
Color get textSelectedWordTableItem => const Color(0xFF232323);
|
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
|
@override
|
||||||
BoxShadow get standardBoxShadow => BoxShadow(
|
BoxShadow get standardBoxShadow => BoxShadow(
|
||||||
color: shadow,
|
color: shadow,
|
||||||
|
|
|
@ -321,6 +321,16 @@ class OledBlackColors extends StackColorTheme {
|
||||||
@override
|
@override
|
||||||
Color get textSelectedWordTableItem => const Color(0xFF143D8E);
|
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
|
@override
|
||||||
BoxShadow get standardBoxShadow => BoxShadow(
|
BoxShadow get standardBoxShadow => BoxShadow(
|
||||||
color: shadow,
|
color: shadow,
|
||||||
|
|
|
@ -178,6 +178,12 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
final Color textConfirmTotalAmount;
|
final Color textConfirmTotalAmount;
|
||||||
final Color textSelectedWordTableItem;
|
final Color textSelectedWordTableItem;
|
||||||
|
|
||||||
|
// rate type toggle
|
||||||
|
final Color rateTypeToggleColorOn;
|
||||||
|
final Color rateTypeToggleColorOff;
|
||||||
|
final Color rateTypeToggleDesktopColorOn;
|
||||||
|
final Color rateTypeToggleDesktopColorOff;
|
||||||
|
|
||||||
final BoxShadow standardBoxShadow;
|
final BoxShadow standardBoxShadow;
|
||||||
final BoxShadow? homeViewButtonBarBoxShadow;
|
final BoxShadow? homeViewButtonBarBoxShadow;
|
||||||
|
|
||||||
|
@ -319,6 +325,10 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
required this.myStackContactIconBG,
|
required this.myStackContactIconBG,
|
||||||
required this.textConfirmTotalAmount,
|
required this.textConfirmTotalAmount,
|
||||||
required this.textSelectedWordTableItem,
|
required this.textSelectedWordTableItem,
|
||||||
|
required this.rateTypeToggleColorOn,
|
||||||
|
required this.rateTypeToggleColorOff,
|
||||||
|
required this.rateTypeToggleDesktopColorOn,
|
||||||
|
required this.rateTypeToggleDesktopColorOff,
|
||||||
required this.standardBoxShadow,
|
required this.standardBoxShadow,
|
||||||
required this.homeViewButtonBarBoxShadow,
|
required this.homeViewButtonBarBoxShadow,
|
||||||
});
|
});
|
||||||
|
@ -465,6 +475,10 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
myStackContactIconBG: colorTheme.myStackContactIconBG,
|
myStackContactIconBG: colorTheme.myStackContactIconBG,
|
||||||
textConfirmTotalAmount: colorTheme.textConfirmTotalAmount,
|
textConfirmTotalAmount: colorTheme.textConfirmTotalAmount,
|
||||||
textSelectedWordTableItem: colorTheme.textSelectedWordTableItem,
|
textSelectedWordTableItem: colorTheme.textSelectedWordTableItem,
|
||||||
|
rateTypeToggleColorOn: colorTheme.rateTypeToggleColorOn,
|
||||||
|
rateTypeToggleColorOff: colorTheme.rateTypeToggleColorOff,
|
||||||
|
rateTypeToggleDesktopColorOn: colorTheme.rateTypeToggleDesktopColorOn,
|
||||||
|
rateTypeToggleDesktopColorOff: colorTheme.rateTypeToggleDesktopColorOff,
|
||||||
homeViewButtonBarBoxShadow: colorTheme.homeViewButtonBarBoxShadow,
|
homeViewButtonBarBoxShadow: colorTheme.homeViewButtonBarBoxShadow,
|
||||||
standardBoxShadow: colorTheme.standardBoxShadow,
|
standardBoxShadow: colorTheme.standardBoxShadow,
|
||||||
);
|
);
|
||||||
|
@ -609,6 +623,10 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
Color? myStackContactIconBG,
|
Color? myStackContactIconBG,
|
||||||
Color? textConfirmTotalAmount,
|
Color? textConfirmTotalAmount,
|
||||||
Color? textSelectedWordTableItem,
|
Color? textSelectedWordTableItem,
|
||||||
|
Color? rateTypeToggleColorOn,
|
||||||
|
Color? rateTypeToggleColorOff,
|
||||||
|
Color? rateTypeToggleDesktopColorOn,
|
||||||
|
Color? rateTypeToggleDesktopColorOff,
|
||||||
BoxShadow? homeViewButtonBarBoxShadow,
|
BoxShadow? homeViewButtonBarBoxShadow,
|
||||||
BoxShadow? standardBoxShadow,
|
BoxShadow? standardBoxShadow,
|
||||||
}) {
|
}) {
|
||||||
|
@ -790,6 +808,14 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
textConfirmTotalAmount ?? this.textConfirmTotalAmount,
|
textConfirmTotalAmount ?? this.textConfirmTotalAmount,
|
||||||
textSelectedWordTableItem:
|
textSelectedWordTableItem:
|
||||||
textSelectedWordTableItem ?? this.textSelectedWordTableItem,
|
textSelectedWordTableItem ?? this.textSelectedWordTableItem,
|
||||||
|
rateTypeToggleColorOn:
|
||||||
|
rateTypeToggleColorOn ?? this.rateTypeToggleColorOn,
|
||||||
|
rateTypeToggleColorOff:
|
||||||
|
rateTypeToggleColorOff ?? this.rateTypeToggleColorOff,
|
||||||
|
rateTypeToggleDesktopColorOn:
|
||||||
|
rateTypeToggleDesktopColorOn ?? this.rateTypeToggleDesktopColorOn,
|
||||||
|
rateTypeToggleDesktopColorOff:
|
||||||
|
rateTypeToggleDesktopColorOff ?? this.rateTypeToggleDesktopColorOff,
|
||||||
homeViewButtonBarBoxShadow:
|
homeViewButtonBarBoxShadow:
|
||||||
homeViewButtonBarBoxShadow ?? this.homeViewButtonBarBoxShadow,
|
homeViewButtonBarBoxShadow ?? this.homeViewButtonBarBoxShadow,
|
||||||
standardBoxShadow: standardBoxShadow ?? this.standardBoxShadow,
|
standardBoxShadow: standardBoxShadow ?? this.standardBoxShadow,
|
||||||
|
@ -1483,6 +1509,26 @@ class StackColors extends ThemeExtension<StackColors> {
|
||||||
other.textSelectedWordTableItem,
|
other.textSelectedWordTableItem,
|
||||||
t,
|
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,
|
||||||
|
)!,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue