- Use close icon on main screens

- Minor UI fixes
This commit is contained in:
OmarHatem 2023-02-16 17:51:52 +02:00
parent 5296a2118a
commit 55bf964a27
7 changed files with 24 additions and 35 deletions

View file

@ -7,7 +7,6 @@ import 'package:cake_wallet/ionia/ionia_anypay.dart';
import 'package:cake_wallet/ionia/ionia_gift_card.dart'; import 'package:cake_wallet/ionia/ionia_gift_card.dart';
import 'package:cake_wallet/ionia/ionia_tip.dart'; import 'package:cake_wallet/ionia/ionia_tip.dart';
import 'package:cake_wallet/src/screens/buy/onramper_page.dart'; import 'package:cake_wallet/src/screens/buy/onramper_page.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart';
import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_page.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/transactions_page.dart';
import 'package:cake_wallet/src/screens/settings/display_settings_page.dart'; import 'package:cake_wallet/src/screens/settings/display_settings_page.dart';

View file

@ -1,4 +1,5 @@
import 'package:cake_wallet/themes/theme_base.dart'; import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart'; import 'package:cake_wallet/palette.dart';
@ -20,7 +21,7 @@ abstract class BasePage extends StatelessWidget {
String? get title => null; String? get title => null;
bool get isModalBackButton => false; bool get canUseCloseIcon => false;
Color get backgroundLightColor => Colors.white; Color get backgroundLightColor => Colors.white;
@ -50,23 +51,27 @@ abstract class BasePage extends StatelessWidget {
} }
final _backButton = Icon(Icons.arrow_back_ios, final _backButton = Icon(Icons.arrow_back_ios,
color: titleColor ?? Theme.of(context).primaryTextTheme!.headline6!.color!, color: titleColor ?? Theme.of(context).primaryTextTheme.headline6!.color!,
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);
return SizedBox( return SizedBox(
height: 37, height: isMobileView ? 37 : 45,
width: 37, width: isMobileView ? 37 : 45,
child: ButtonTheme( child: ButtonTheme(
minWidth: double.minPositive, minWidth: double.minPositive,
child: TextButton( child: TextButton(
// FIX-ME: Style style: ButtonStyle(
//highlightColor: Colors.transparent, overlayColor: MaterialStateColor.resolveWith((states) => Colors.transparent),
//splashColor: Colors.transparent, ),
//padding: EdgeInsets.all(0),
onPressed: () => onClose(context), onPressed: () => onClose(context),
child: isModalBackButton ? _closeButton : _backButton), child: canUseCloseIcon && !isMobileView
? _closeButton
: _backButton,
),
), ),
); );
} }

View file

@ -24,7 +24,6 @@ import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import 'package:cake_wallet/main.dart'; import 'package:cake_wallet/main.dart';
import 'package:cake_wallet/router.dart' as Router;
class DashboardPage extends StatelessWidget { class DashboardPage extends StatelessWidget {
DashboardPage({ DashboardPage({
@ -52,7 +51,6 @@ class DashboardPage extends StatelessWidget {
desktopSidebarViewModel: desktopSidebarViewModel, desktopSidebarViewModel: desktopSidebarViewModel,
dashboardViewModel: dashboardViewModel, dashboardViewModel: dashboardViewModel,
child: DesktopDashboardPage( child: DesktopDashboardPage(
desktopSidebarViewModel: desktopSidebarViewModel,
balancePage: balancePage, balancePage: balancePage,
dashboardViewModel: dashboardViewModel, dashboardViewModel: dashboardViewModel,
addressListViewModel: addressListViewModel, addressListViewModel: addressListViewModel,

View file

@ -4,7 +4,6 @@ import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/yat_emoji_id.dart'; import 'package:cake_wallet/src/screens/yat_emoji_id.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/dashboard/desktop_sidebar_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.dart';
@ -18,13 +17,11 @@ class DesktopDashboardPage extends StatelessWidget {
required this.balancePage, required this.balancePage,
required this.dashboardViewModel, required this.dashboardViewModel,
required this.addressListViewModel, required this.addressListViewModel,
required this.desktopSidebarViewModel,
}); });
final BalancePage balancePage; final BalancePage balancePage;
final DashboardViewModel dashboardViewModel; final DashboardViewModel dashboardViewModel;
final WalletAddressListViewModel addressListViewModel; final WalletAddressListViewModel addressListViewModel;
final DesktopSidebarViewModel desktopSidebarViewModel;
static final GlobalKey<NavigatorState> desktopKey = GlobalKey<NavigatorState>(); static final GlobalKey<NavigatorState> desktopKey = GlobalKey<NavigatorState>();

View file

@ -42,26 +42,10 @@ class AddressPage extends BasePage {
bool get resizeToAvoidBottomInset => false; bool get resizeToAvoidBottomInset => false;
@override @override
Widget leading(BuildContext context) { Color get titleColor => Colors.white;
final _backButton = Icon(Icons.arrow_back_ios,
color: Theme.of(context).accentTextTheme!.headline2!.backgroundColor!,
size: 16,);
return SizedBox( @override
height: 37, bool get canUseCloseIcon => true;
width: 37,
child: ButtonTheme(
minWidth: double.minPositive,
child: TextButton(
// FIX-ME: Style
//highlightColor: Colors.transparent,
//splashColor: Colors.transparent,
//padding: EdgeInsets.all(0),
onPressed: () => onClose(context),
child: _backButton),
),
);
}
@override @override
Widget middle(BuildContext context) { Widget middle(BuildContext context) {

View file

@ -108,6 +108,9 @@ class ExchangePage extends BasePage {
exchangeViewModel.reset(); exchangeViewModel.reset();
}); });
@override
bool get canUseCloseIcon => true;
@override @override
Widget body(BuildContext context) { Widget body(BuildContext context) {
WidgetsBinding.instance WidgetsBinding.instance

View file

@ -51,6 +51,9 @@ class SendPage extends BasePage {
@override @override
bool get extendBodyBehindAppBar => true; bool get extendBodyBehindAppBar => true;
@override
bool get canUseCloseIcon => true;
@override @override
AppBarStyle get appBarStyle => AppBarStyle.transparent; AppBarStyle get appBarStyle => AppBarStyle.transparent;
@ -58,7 +61,7 @@ class SendPage extends BasePage {
final double initialHeight = sendViewModel.isElectrumWallet ? 490 : 465; final double initialHeight = sendViewModel.isElectrumWallet ? 490 : 465;
if (!ResponsiveLayoutUtil.instance.isMobile(context)) { if (!ResponsiveLayoutUtil.instance.isMobile(context)) {
return initialHeight - 77; return initialHeight - 66;
} }
return initialHeight; return initialHeight;
} }