textRestore added for color fix

This commit is contained in:
ryleedavis 2023-01-10 15:28:59 -07:00
parent a90f7fe994
commit 9f5ce0db7a
7 changed files with 33 additions and 7 deletions

View file

@ -373,17 +373,22 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
FormInputStatus status, String prefix) {
Color color;
Color prefixColor;
Color borderColor;
Widget? suffixIcon;
switch (status) {
case FormInputStatus.empty:
color = Theme.of(context).extension<StackColors>()!.textFieldDefaultBG;
prefixColor = Theme.of(context).extension<StackColors>()!.textSubtitle2;
borderColor =
Theme.of(context).extension<StackColors>()!.textFieldDefaultBG;
break;
case FormInputStatus.invalid:
color = Theme.of(context).extension<StackColors>()!.textFieldErrorBG;
prefixColor = Theme.of(context)
.extension<StackColors>()!
.textFieldErrorSearchIconLeft;
borderColor =
Theme.of(context).extension<StackColors>()!.textFieldErrorBorder;
suffixIcon = SvgPicture.asset(
Assets.svg.alertCircle,
width: 16,
@ -398,6 +403,8 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
prefixColor = Theme.of(context)
.extension<StackColors>()!
.textFieldSuccessSearchIconLeft;
borderColor =
Theme.of(context).extension<StackColors>()!.textFieldSuccessBorder;
suffixIcon = SvgPicture.asset(
Assets.svg.checkCircle,
width: 16,
@ -449,11 +456,11 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
child: suffixIcon,
),
),
enabledBorder: _buildOutlineInputBorder(color),
focusedBorder: _buildOutlineInputBorder(color),
errorBorder: _buildOutlineInputBorder(color),
disabledBorder: _buildOutlineInputBorder(color),
focusedErrorBorder: _buildOutlineInputBorder(color),
enabledBorder: _buildOutlineInputBorder(borderColor),
focusedBorder: _buildOutlineInputBorder(borderColor),
errorBorder: _buildOutlineInputBorder(borderColor),
disabledBorder: _buildOutlineInputBorder(borderColor),
focusedErrorBorder: _buildOutlineInputBorder(borderColor),
);
}
@ -786,7 +793,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
.copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.overlay,
.textRestore,
fontSize: isDesktop ? 16 : 14,
),
),
@ -993,7 +1000,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
STextStyles.field(context).copyWith(
color: Theme.of(context)
.extension<StackColors>()!
.overlay,
.textRestore,
fontSize: isDesktop ? 16 : 14,
),
),

View file

@ -68,6 +68,7 @@ abstract class StackColorTheme {
Color get textWhite;
Color get textFavoriteCard;
Color get textError;
Color get textRestore;
// button background
Color get buttonBackPrimary;

View file

@ -55,6 +55,8 @@ class DarkColors extends StackColorTheme {
Color get textFavoriteCard => const Color(0xFF232323);
@override
Color get textError => const Color(0xFFF37475);
@override
Color get textRestore => overlay;
// button background
@override

View file

@ -55,6 +55,8 @@ class LightColors extends StackColorTheme {
Color get textFavoriteCard => const Color(0xFF232323);
@override
Color get textError => const Color(0xFF930006);
@override
Color get textRestore => overlay;
// button background
@override

View file

@ -62,6 +62,8 @@ class OceanBreezeColors extends StackColorTheme {
Color get textFavoriteCard => const Color(0xFF232323);
@override
Color get textError => const Color(0xFF8D0006);
@override
Color get textRestore => overlay;
// button background
@override

View file

@ -56,6 +56,8 @@ class OledBlackColors extends StackColorTheme {
Color get textFavoriteCard => const Color(0xFF232323);
@override
Color get textError => const Color(0xFFCF6679);
@override
Color get textRestore => textDark;
// button background
@override

View file

@ -32,6 +32,7 @@ class StackColors extends ThemeExtension<StackColors> {
final Color textWhite;
final Color textFavoriteCard;
final Color textError;
final Color textRestore;
// button background
final Color buttonBackPrimary;
@ -200,6 +201,7 @@ class StackColors extends ThemeExtension<StackColors> {
required this.textWhite,
required this.textFavoriteCard,
required this.textError,
required this.textRestore,
required this.buttonBackPrimary,
required this.buttonBackSecondary,
required this.buttonBackPrimaryDisabled,
@ -338,6 +340,7 @@ class StackColors extends ThemeExtension<StackColors> {
textWhite: colorTheme.textWhite,
textFavoriteCard: colorTheme.textFavoriteCard,
textError: colorTheme.textError,
textRestore: colorTheme.textRestore,
buttonBackPrimary: colorTheme.buttonBackPrimary,
buttonBackSecondary: colorTheme.buttonBackSecondary,
buttonBackPrimaryDisabled: colorTheme.buttonBackPrimaryDisabled,
@ -479,6 +482,7 @@ class StackColors extends ThemeExtension<StackColors> {
Color? textWhite,
Color? textFavoriteCard,
Color? textError,
Color? textRestore,
Color? buttonBackPrimary,
Color? buttonBackSecondary,
Color? buttonBackPrimaryDisabled,
@ -615,6 +619,7 @@ class StackColors extends ThemeExtension<StackColors> {
textWhite: textWhite ?? this.textWhite,
textFavoriteCard: textFavoriteCard ?? this.textFavoriteCard,
textError: textError ?? this.textError,
textRestore: textRestore ?? this.textRestore,
buttonBackPrimary: buttonBackPrimary ?? this.buttonBackPrimary,
buttonBackSecondary: buttonBackSecondary ?? this.buttonBackSecondary,
buttonBackPrimaryDisabled:
@ -888,6 +893,11 @@ class StackColors extends ThemeExtension<StackColors> {
other.textError,
t,
)!,
textRestore: Color.lerp(
textRestore,
other.textRestore,
t,
)!,
buttonBackPrimary: Color.lerp(
buttonBackPrimary,
other.buttonBackPrimary,