Cw 363 back button on receive screen in bright theme is white (#910)

* feat: Add missing title on wallet_list_page.dart

* feat: add bool lightTitleColor value when theme needs lighter color title, instead of hardcoding to Colors.white

- Light color theme taken from Share button from receive page

* fix: revert changes & use currentTheme.type to use proper theme style

* fix: use share button color logic also on overriden leading Widget on address_page

* refactor: remove unnecessary titleColor
This commit is contained in:
Rafael Saes 2023-05-03 21:33:05 -03:00 committed by GitHub
parent f47f690803
commit f012aaebf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 8 deletions

View file

@ -59,17 +59,16 @@ class AddressPage extends BasePage {
bool effectsInstalled = false; bool effectsInstalled = false;
@override
Color get titleColor => Colors.white;
@override @override
Widget? leading(BuildContext context) { Widget? leading(BuildContext context) {
final _backButton = Icon(Icons.arrow_back_ios, final _backButton = Icon(
color: titleColor, Icons.arrow_back_ios,
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!,
size: 16, size: 16,
); );
final _closeButton = currentTheme.type == ThemeType.dark final _closeButton = currentTheme.type == ThemeType.dark
? closeButtonImageDarkTheme : closeButtonImage; ? closeButtonImageDarkTheme
: closeButtonImage;
bool isMobileView = ResponsiveLayoutUtil.instance.isMobile(context); bool isMobileView = ResponsiveLayoutUtil.instance.isMobile(context);
@ -84,7 +83,7 @@ class AddressPage extends BasePage {
child: TextButton( child: TextButton(
style: ButtonStyle( style: ButtonStyle(
overlayColor: MaterialStateColor.resolveWith( overlayColor: MaterialStateColor.resolveWith(
(states) => Colors.transparent), (states) => Colors.transparent),
), ),
onPressed: () => onClose(context), onPressed: () => onClose(context),
child: !isMobileView ? _closeButton : _backButton, child: !isMobileView ? _closeButton : _backButton,

View file

@ -53,7 +53,8 @@ class ReceivePage extends BasePage {
final FocusNode _cryptoAmountFocus; final FocusNode _cryptoAmountFocus;
@override @override
Color get titleColor => Colors.white; Color? get titleColor =>
currentTheme.type == ThemeType.bright ? Colors.white : null;
@override @override
Widget middle(BuildContext context) { Widget middle(BuildContext context) {

View file

@ -24,6 +24,9 @@ class WalletListPage extends BasePage {
final WalletListViewModel walletListViewModel; final WalletListViewModel walletListViewModel;
final AuthService authService; final AuthService authService;
@override
String get title => S.current.wallets;
@override @override
Widget body(BuildContext context) => Widget body(BuildContext context) =>
WalletListBody(walletListViewModel: walletListViewModel, authService: authService); WalletListBody(walletListViewModel: walletListViewModel, authService: authService);