refactor: create PinCodeTheme for accentTextTheme.bodyMedium

This commit is contained in:
Rafael Saes 2023-07-03 13:38:39 -03:00
parent 2ef03ceda9
commit 4ffeb21c4c
6 changed files with 22 additions and 27 deletions

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:another_flushbar/flushbar.dart';
@ -163,10 +164,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
.primaryTextTheme!
.titleLarge!
.color!
: Theme.of(context)
.accentTextTheme!
.bodyMedium!
.color!
: Theme.of(context).extension<PinCodeTheme>()!.indicatorsColor
.withOpacity(0.25),
));
}),
@ -185,10 +183,7 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
style: TextStyle(
fontSize: 14.0,
fontWeight: FontWeight.normal,
color: Theme.of(context)
.accentTextTheme!
.bodyMedium!
.decorationColor!),
color: Theme.of(context).extension<PinCodeTheme>()!.switchColor),
),
)
],

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/utils/share_util.dart';
@ -185,10 +186,7 @@ class WalletSeedPage extends BasePage {
S.of(context).copied_to_clipboard);
},
text: S.of(context).copy,
color: Theme.of(context)
.accentTextTheme!
.bodyMedium!
.color!,
color: Theme.of(context).extension<PinCodeTheme>()!.indicatorsColor,
textColor: Colors.white)),
))
],

View file

@ -235,9 +235,5 @@ class BrightTheme extends LightTheme {
backgroundColor: Colors.black, // icon color on support page (moonpay, github)
decorationColor: Colors.white.withOpacity(0.4) // hint text (exchange page)
),
// body -> bodyMedium
bodyMedium: TextStyle(
color: Palette.darkGray, // indicators (PIN code)
decorationColor: Palette.darkGray, // switch (PIN code)
)));
));
}

View file

@ -1,5 +1,6 @@
import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/generated/i18n.dart';
@ -41,6 +42,11 @@ class DarkTheme extends ThemeBase {
KeyboardTheme get keyboardTheme =>
KeyboardTheme(keyboardBarColor: PaletteDark.granite);
@override
PinCodeTheme get pinCodeTheme => PinCodeTheme(
indicatorsColor: PaletteDark.indicatorVioletBlue,
switchColor: PaletteDark.lightPurpleBlue);
@override
ThemeData get themeData => super.themeData.copyWith(
indicatorColor: PaletteDark.cyanBlue, // page indicator
@ -254,11 +260,6 @@ class DarkTheme extends ThemeBase {
decorationColor:
PaletteDark.lightBlueGrey // hint text (exchange page)
),
// body1 -> bodyMedium
bodyMedium: TextStyle(
color: PaletteDark.indicatorVioletBlue, // indicators (PIN code)
decorationColor: PaletteDark.lightPurpleBlue, // switch (PIN code)
),
),
);
}

View file

@ -1,5 +1,6 @@
import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/generated/i18n.dart';
@ -42,6 +43,11 @@ class LightTheme extends ThemeBase {
KeyboardTheme get keyboardTheme =>
KeyboardTheme(keyboardBarColor: Palette.dullGray);
@override
PinCodeTheme get pinCodeTheme => PinCodeTheme(
indicatorsColor: Palette.darkGray,
switchColor: Palette.darkGray);
@override
ThemeData get themeData => super.themeData.copyWith(
indicatorColor:
@ -250,11 +256,6 @@ class LightTheme extends ThemeBase {
decorationColor:
Colors.white.withOpacity(0.4) // hint text (exchange page)
),
// body -> bodyMedium
bodyMedium: TextStyle(
color: Palette.darkGray, // indicators (PIN code)
decorationColor: Palette.darkGray, // switch (PIN code)
),
),
);
}

View file

@ -1,6 +1,7 @@
import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_gradient_theme.dart';
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:flutter/material.dart';
@ -45,6 +46,8 @@ abstract class ThemeBase {
KeyboardTheme get keyboardTheme;
PinCodeTheme get pinCodeTheme;
ThemeData get themeData => generatedThemeData.copyWith(
primaryColor: primaryColor,
cardColor: containerColor,
@ -54,6 +57,7 @@ abstract class ThemeBase {
scrollbarTheme,
syncIndicatorStyle,
keyboardTheme,
pinCodeTheme,
],
scrollbarTheme: ScrollbarThemeData(
thumbColor: MaterialStateProperty.all(scrollbarTheme.thumbColor),