From a116241185df8c0497334d2f48da4cc9404fec62 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Thu, 9 Feb 2023 19:17:52 +0200 Subject: [PATCH 1/6] Separate Dashboard desktop view from mobile view --- lib/src/screens/dashboard/dashboard_page.dart | 36 ++--- .../dashboard/desktop_dashboard_page.dart | 125 ++++++++++++++++++ .../desktop_sidebar_wrapper.dart | 6 +- lib/src/widgets/nav_bar.dart | 19 +-- 4 files changed, 151 insertions(+), 35 deletions(-) create mode 100644 lib/src/screens/dashboard/desktop_dashboard_page.dart diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index baccfa0ea..5e560cc01 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -1,9 +1,7 @@ import 'dart:async'; -import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/entities/main_actions.dart'; +import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.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_dashboard_view.dart'; import 'package:cake_wallet/src/screens/dashboard/widgets/market_place_page.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/routes.dart'; @@ -40,13 +38,19 @@ class DashboardPage extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - body: DesktopSidebarWrapper( - child: _DashboardPageView( - balancePage: balancePage, - walletViewModel: walletViewModel, - addressListViewModel: addressListViewModel, - ), - ), + body: ResponsiveLayoutUtil.instance.isMobile(context) + ? _DashboardPageView( + balancePage: balancePage, + walletViewModel: walletViewModel, + addressListViewModel: addressListViewModel, + ) + : DesktopSidebarWrapper( + child: DesktopDashboardPage( + balancePage: balancePage, + walletViewModel: walletViewModel, + addressListViewModel: addressListViewModel, + ), + ), ); } } @@ -84,15 +88,6 @@ class _DashboardPageView extends BasePage { @override Widget get endDrawer => MenuWidget(walletViewModel); - @override - Widget? leading(BuildContext context) { - if (!ResponsiveLayoutUtil.instance.isMobile(context)) { - return getIt(); - } - - return null; - } - @override Widget middle(BuildContext context) { return SyncIndicator( @@ -128,9 +123,6 @@ class _DashboardPageView extends BasePage { @override Widget body(BuildContext context) { _setEffects(context); - if (!ResponsiveLayoutUtil.instance.isMobile(context)) { - return DesktopDashboardView(balancePage); - } return SafeArea( minimum: EdgeInsets.only(bottom: 24), diff --git a/lib/src/screens/dashboard/desktop_dashboard_page.dart b/lib/src/screens/dashboard/desktop_dashboard_page.dart new file mode 100644 index 000000000..bbef96d3b --- /dev/null +++ b/lib/src/screens/dashboard/desktop_dashboard_page.dart @@ -0,0 +1,125 @@ +import 'dart:async'; +import 'package:cake_wallet/di.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_dashboard_view.dart'; +import 'package:cake_wallet/generated/i18n.dart'; +import 'package:cake_wallet/routes.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/themes/theme_base.dart'; +import 'package:cake_wallet/utils/show_pop_up.dart'; +import 'package:flutter/material.dart'; +import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; +import 'package:cake_wallet/src/screens/base_page.dart'; +import 'package:cake_wallet/src/screens/dashboard/widgets/balance_page.dart'; +import 'package:cake_wallet/src/screens/dashboard/widgets/sync_indicator.dart'; +import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart'; +import 'package:mobx/mobx.dart'; +import 'package:cake_wallet/main.dart'; + +class DesktopDashboardPage extends BasePage { + DesktopDashboardPage({ + required this.balancePage, + required this.walletViewModel, + required this.addressListViewModel, + }); + + @override + Color get backgroundLightColor => + currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white; + + @override + Color get backgroundDarkColor => Colors.transparent; + + @override + Widget Function(BuildContext, Widget) get rootWrapper => + (BuildContext context, Widget scaffold) => Container( + decoration: BoxDecoration( + gradient: LinearGradient(colors: [ + Theme.of(context).accentColor, + Theme.of(context).scaffoldBackgroundColor, + Theme.of(context).primaryColor, + ], begin: Alignment.topRight, end: Alignment.bottomLeft)), + child: scaffold); + + @override + bool get resizeToAvoidBottomInset => false; + + @override + Widget? leading(BuildContext context) => getIt(); + + @override + Widget middle(BuildContext context) { + return SyncIndicator( + dashboardViewModel: walletViewModel, + onTap: () => Navigator.of(context, rootNavigator: true).pushNamed(Routes.connectionSync)); + } + + @override + Widget trailing(BuildContext context) { + return Image.asset('assets/images/menu.png', + color: Theme.of(context).accentTextTheme.headline2!.backgroundColor!); + } + + final BalancePage balancePage; + final DashboardViewModel walletViewModel; + final WalletAddressListViewModel addressListViewModel; + + bool _isEffectsInstalled = false; + StreamSubscription? _onInactiveSub; + + @override + Widget body(BuildContext context) { + _setEffects(context); + + return DesktopDashboardView(balancePage); + } + + void _setEffects(BuildContext context) async { + if (_isEffectsInstalled) { + return; + } + _isEffectsInstalled = true; + + autorun((_) async { + if (!walletViewModel.isOutdatedElectrumWallet) { + return; + } + + await Future.delayed(Duration(seconds: 1)); + await showPopUp( + context: context, + builder: (BuildContext context) { + return AlertWithOneAction( + alertTitle: S.of(context).pre_seed_title, + alertContent: S.of(context).outdated_electrum_wallet_description, + buttonText: S.of(context).understand, + buttonAction: () => Navigator.of(context).pop()); + }); + }); + + var needToPresentYat = false; + var isInactive = false; + + _onInactiveSub = rootKey.currentState!.isInactive.listen((inactive) { + isInactive = inactive; + + if (needToPresentYat) { + Future.delayed(Duration(milliseconds: 500)).then((_) { + showPopUp( + context: navigatorKey.currentContext!, + builder: (_) => YatEmojiId(walletViewModel.yatStore.emoji)); + needToPresentYat = false; + }); + } + }); + + walletViewModel.yatStore.emojiIncommingStream.listen((String emoji) { + if (!_isEffectsInstalled || emoji.isEmpty) { + return; + } + + needToPresentYat = true; + }); + } +} diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart index 85320c6ef..84acd42a0 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart @@ -2,7 +2,6 @@ import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_controller.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart'; -import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/router.dart' as Router; @@ -18,6 +17,7 @@ class DesktopSidebarWrapper extends StatefulWidget { class _DesktopSidebarWrapperState extends State { final page = PageController(); final sideMenu = SideMenuController(); + @override void initState() { SideMenuGlobal.controller = sideMenu; @@ -29,10 +29,6 @@ class _DesktopSidebarWrapperState extends State { @override Widget build(BuildContext context) { - if (ResponsiveLayoutUtil.instance.isMobile(context)) { - return widget.child; - } - return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/src/widgets/nav_bar.dart b/lib/src/widgets/nav_bar.dart index b6e8f9fb9..657031bfa 100644 --- a/lib/src/widgets/nav_bar.dart +++ b/lib/src/widgets/nav_bar.dart @@ -66,14 +66,17 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget { if (!ResponsiveLayoutUtil.instance.isMobile(context)) { return PreferredSize( preferredSize: Size.fromHeight(height), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - if (leading != null) Flexible(child: leading!), - if (middle != null) middle!, - if (trailing != null) trailing!, - ], + child: Padding( + padding: const EdgeInsetsDirectional.only(end: 24), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (leading != null) Flexible(child: leading!), + if (middle != null) middle!, + if (trailing != null) trailing!, + ], + ), ), ); } From 677305f6257669dea097e8c82f8d019621f1cf93 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Thu, 9 Feb 2023 22:53:02 +0200 Subject: [PATCH 2/6] - Listen to keyboard events in PIN screen - Fix PIN buttons style --- lib/src/screens/pin_code/pin_code_widget.dart | 263 ++++++++++-------- 1 file changed, 141 insertions(+), 122 deletions(-) diff --git a/lib/src/screens/pin_code/pin_code_widget.dart b/lib/src/screens/pin_code/pin_code_widget.dart index a647f3d95..2792474b2 100644 --- a/lib/src/screens/pin_code/pin_code_widget.dart +++ b/lib/src/screens/pin_code/pin_code_widget.dart @@ -2,6 +2,7 @@ import 'package:cake_wallet/utils/show_bar.dart'; import 'package:another_flushbar/flushbar.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/generated/i18n.dart'; +import 'package:flutter/services.dart'; class PinCodeWidget extends StatefulWidget { PinCodeWidget( @@ -117,87 +118,102 @@ class PinCodeState extends State { color: Theme.of(context).primaryTextTheme!.headline6!.color!, ); - return Container( - color: Theme.of(context).backgroundColor, - padding: EdgeInsets.only(left: 40.0, right: 40.0, bottom: 40.0), - child: Column(children: [ - Spacer(flex: 2), - Text(title, - style: TextStyle( - fontSize: 20, - fontWeight: FontWeight.w500, - color: Theme.of(context).primaryTextTheme!.headline6!.color!)), - Spacer(flex: 3), - Container( - width: 180, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: List.generate(pinLength, (index) { - const size = 10.0; - final isFilled = pin.length > index ? pin[index] != null : false; + return RawKeyboardListener( + focusNode: FocusNode(), + autofocus: true, + onKey: (keyEvent) { + if (keyEvent is RawKeyDownEvent) { + if (keyEvent.logicalKey.keyLabel == "Backspace") { + _pop(); + return; + } + int? number = int.tryParse(keyEvent.character ?? ''); + if (number != null) { + _push(number); + } + } + }, + child: Container( + color: Theme.of(context).backgroundColor, + padding: EdgeInsets.only(left: 40.0, right: 40.0, bottom: 40.0), + child: Column(children: [ + Spacer(flex: 2), + Text(title, + style: TextStyle( + fontSize: 20, + fontWeight: FontWeight.w500, + color: Theme.of(context).primaryTextTheme!.headline6!.color!)), + Spacer(flex: 3), + Container( + width: 180, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: List.generate(pinLength, (index) { + const size = 10.0; + final isFilled = pin.length > index ? pin[index] != null : false; - return Container( - width: size, - height: size, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: isFilled - ? Theme.of(context).primaryTextTheme!.headline6!.color! - : Theme.of(context) - .accentTextTheme! - .bodyText2! - .color! - .withOpacity(0.25), - )); - }), + return Container( + width: size, + height: size, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: isFilled + ? Theme.of(context).primaryTextTheme!.headline6!.color! + : Theme.of(context) + .accentTextTheme! + .bodyText2! + .color! + .withOpacity(0.25), + )); + }), + ), ), - ), - Spacer(flex: 2), - if (widget.hasLengthSwitcher) ...[ - TextButton( - onPressed: () { - changePinLength(pinLength == PinCodeState.fourPinLength - ? PinCodeState.sixPinLength - : PinCodeState.fourPinLength); - }, - child: Text( - _changePinLengthText(), - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.normal, - color: Theme.of(context) - .accentTextTheme! - .bodyText2! - .decorationColor!), - )) - ], - Spacer(flex: 1), - Flexible( - flex: 24, - child: Container( - key: _gridViewKey, - child: _aspectRatio > 0 - ? GridView.count( - shrinkWrap: true, - crossAxisCount: 3, - childAspectRatio: _aspectRatio, - physics: const NeverScrollableScrollPhysics(), - children: List.generate(12, (index) { - const double marginRight = 15; - const double marginLeft = 15; + Spacer(flex: 2), + if (widget.hasLengthSwitcher) ...[ + TextButton( + onPressed: () { + changePinLength(pinLength == PinCodeState.fourPinLength + ? PinCodeState.sixPinLength + : PinCodeState.fourPinLength); + }, + child: Text( + _changePinLengthText(), + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.normal, + color: Theme.of(context) + .accentTextTheme! + .bodyText2! + .decorationColor!), + )) + ], + Spacer(flex: 1), + Flexible( + flex: 24, + child: Container( + key: _gridViewKey, + child: _aspectRatio > 0 + ? GridView.count( + shrinkWrap: true, + crossAxisCount: 3, + childAspectRatio: _aspectRatio, + physics: const NeverScrollableScrollPhysics(), + children: List.generate(12, (index) { + const double marginRight = 15; + const double marginLeft = 15; - if (index == 9) { - return Container( - margin: EdgeInsets.only( - left: marginLeft, right: marginRight), - child: TextButton( - onPressed: () => null, - // (widget.hasLengthSwitcher || - // !settingsStore - // .allowBiometricalAuthentication) - // ? null - // : () { - // FIXME + if (index == 9) { + return Container( + margin: EdgeInsets.only( + left: marginLeft, right: marginRight), + child: TextButton( + onPressed: () => null, + // (widget.hasLengthSwitcher || + // !settingsStore + // .allowBiometricalAuthentication) + // ? null + // : () { + // FIXME // if (authStore != null) { // WidgetsBinding.instance.addPostFrameCallback((_) { // final biometricAuth = BiometricAuth(); @@ -217,57 +233,60 @@ class PinCodeState extends State { // }); // } // }, - // FIX-ME: Style - //color: Theme.of(context).backgroundColor, - //shape: CircleBorder(), - child: Container() - // (widget.hasLengthSwitcher || - // !settingsStore - // .allowBiometricalAuthentication) - // ? Offstage() - // : faceImage, + // FIX-ME: Style + //color: Theme.of(context).backgroundColor, + //shape: CircleBorder(), + child: Container() + // (widget.hasLengthSwitcher || + // !settingsStore + // .allowBiometricalAuthentication) + // ? Offstage() + // : faceImage, + ), + ); + } else if (index == 10) { + index = 0; + } else if (index == 11) { + return Container( + margin: EdgeInsets.only( + left: marginLeft, right: marginRight), + child: TextButton( + onPressed: () => _pop(), + style: TextButton.styleFrom( + backgroundColor: Theme.of(context).backgroundColor, + shape: CircleBorder(), ), - ); - } else if (index == 10) { - index = 0; - } else if (index == 11) { + child: deleteIconImage, + ), + ); + } else { + index++; + } + return Container( margin: EdgeInsets.only( left: marginLeft, right: marginRight), child: TextButton( - onPressed: () => _pop(), - // FIX-ME: Style - //color: Theme.of(context).backgroundColor, - //shape: CircleBorder(), - child: deleteIconImage, + onPressed: () => _push(index), + style: TextButton.styleFrom( + backgroundColor: Theme.of(context).backgroundColor, + shape: CircleBorder(), + ), + child: Text('$index', + style: TextStyle( + fontSize: 30.0, + fontWeight: FontWeight.w600, + color: Theme.of(context) + .primaryTextTheme! + .headline6! + .color!)), ), ); - } else { - index++; - } - - return Container( - margin: EdgeInsets.only( - left: marginLeft, right: marginRight), - child: TextButton( - onPressed: () => _push(index), - // FIX-ME: Style - //color: Theme.of(context).backgroundColor, - //shape: CircleBorder(), - child: Text('$index', - style: TextStyle( - fontSize: 30.0, - fontWeight: FontWeight.w600, - color: Theme.of(context) - .primaryTextTheme! - .headline6! - .color!)), - ), - ); - }), - ) - : null)) - ]), + }), + ) + : null)) + ]), + ), ); } From 2ea360d81de9cca608e02cbc9577daa998727ca2 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 10 Feb 2023 18:15:05 +0200 Subject: [PATCH 3/6] Fix desktop nav bar UI --- lib/src/widgets/nav_bar.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/widgets/nav_bar.dart b/lib/src/widgets/nav_bar.dart index 657031bfa..fcea49656 100644 --- a/lib/src/widgets/nav_bar.dart +++ b/lib/src/widgets/nav_bar.dart @@ -74,7 +74,7 @@ class NavBar extends StatelessWidget implements ObstructingPreferredSizeWidget { children: [ if (leading != null) Flexible(child: leading!), if (middle != null) middle!, - if (trailing != null) trailing!, + trailing ?? const SizedBox(), ], ), ), From 6d49e6a5433495f9054dc26953dc065d84bf33f8 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 10 Feb 2023 18:40:50 +0200 Subject: [PATCH 4/6] Add Marketplace to dashboard view --- .../dashboard/desktop_widgets/desktop_dashboard_actions.dart | 4 ++++ lib/src/widgets/market_place_item.dart | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart index 3e6b8afd9..d97ce8cd1 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart @@ -1,5 +1,6 @@ import 'package:cake_wallet/entities/main_actions.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_action_button.dart'; +import 'package:cake_wallet/src/screens/dashboard/widgets/market_place_page.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:flutter/material.dart'; @@ -65,6 +66,9 @@ class DesktopDashboardActions extends StatelessWidget { ), ], ), + Expanded( + child: MarketPlacePage(dashboardViewModel: dashboardViewModel), + ), ], ); } diff --git a/lib/src/widgets/market_place_item.dart b/lib/src/widgets/market_place_item.dart index 8049a6346..8b8963bbe 100644 --- a/lib/src/widgets/market_place_item.dart +++ b/lib/src/widgets/market_place_item.dart @@ -15,7 +15,7 @@ class MarketPlaceItem extends StatelessWidget { @override Widget build(BuildContext context) { - return InkWell( + return GestureDetector( onTap: onTap, child: Stack( children: [ From 2b2bebe98f45b30bcd7eaaf74c40fb79ab49f845 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 10 Feb 2023 20:26:07 +0200 Subject: [PATCH 5/6] Refresh desktop dashboard actions on wallet change --- .../desktop_dashboard_actions.dart | 109 +++++++++--------- 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart b/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart index 3e6b8afd9..1227ea478 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart @@ -2,6 +2,7 @@ import 'package:cake_wallet/entities/main_actions.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_action_button.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_mobx/flutter_mobx.dart'; class DesktopDashboardActions extends StatelessWidget { final DashboardViewModel dashboardViewModel; @@ -10,62 +11,66 @@ class DesktopDashboardActions extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( - children: [ - const SizedBox(height: 16), - DesktopActionButton( - title: MainActions.exchangeAction.name(context), - image: MainActions.exchangeAction.image, - canShow: MainActions.exchangeAction.canShow?.call(dashboardViewModel), - isEnabled: MainActions.exchangeAction.isEnabled?.call(dashboardViewModel), - onTap: () async => await MainActions.exchangeAction.onTap(context, dashboardViewModel), - ), - Row( + return Observer( + builder: (_) { + return Column( children: [ - Expanded( - child: DesktopActionButton( - title: MainActions.receiveAction.name(context), - image: MainActions.receiveAction.image, - canShow: MainActions.receiveAction.canShow?.call(dashboardViewModel), - isEnabled: MainActions.receiveAction.isEnabled?.call(dashboardViewModel), - onTap: () async => - await MainActions.receiveAction.onTap(context, dashboardViewModel), - ), + const SizedBox(height: 16), + DesktopActionButton( + title: MainActions.exchangeAction.name(context), + image: MainActions.exchangeAction.image, + canShow: MainActions.exchangeAction.canShow?.call(dashboardViewModel), + isEnabled: MainActions.exchangeAction.isEnabled?.call(dashboardViewModel), + onTap: () async => await MainActions.exchangeAction.onTap(context, dashboardViewModel), ), - Expanded( - child: DesktopActionButton( - title: MainActions.sendAction.name(context), - image: MainActions.sendAction.image, - canShow: MainActions.sendAction.canShow?.call(dashboardViewModel), - isEnabled: MainActions.sendAction.isEnabled?.call(dashboardViewModel), - onTap: () async => await MainActions.sendAction.onTap(context, dashboardViewModel), - ), + Row( + children: [ + Expanded( + child: DesktopActionButton( + title: MainActions.receiveAction.name(context), + image: MainActions.receiveAction.image, + canShow: MainActions.receiveAction.canShow?.call(dashboardViewModel), + isEnabled: MainActions.receiveAction.isEnabled?.call(dashboardViewModel), + onTap: () async => + await MainActions.receiveAction.onTap(context, dashboardViewModel), + ), + ), + Expanded( + child: DesktopActionButton( + title: MainActions.sendAction.name(context), + image: MainActions.sendAction.image, + canShow: MainActions.sendAction.canShow?.call(dashboardViewModel), + isEnabled: MainActions.sendAction.isEnabled?.call(dashboardViewModel), + onTap: () async => await MainActions.sendAction.onTap(context, dashboardViewModel), + ), + ), + ], + ), + Row( + children: [ + Expanded( + child: DesktopActionButton( + title: MainActions.buyAction.name(context), + image: MainActions.buyAction.image, + canShow: MainActions.buyAction.canShow?.call(dashboardViewModel), + isEnabled: MainActions.buyAction.isEnabled?.call(dashboardViewModel), + onTap: () async => await MainActions.buyAction.onTap(context, dashboardViewModel), + ), + ), + Expanded( + child: DesktopActionButton( + title: MainActions.sellAction.name(context), + image: MainActions.sellAction.image, + canShow: MainActions.sellAction.canShow?.call(dashboardViewModel), + isEnabled: MainActions.sellAction.isEnabled?.call(dashboardViewModel), + onTap: () async => await MainActions.sellAction.onTap(context, dashboardViewModel), + ), + ), + ], ), ], - ), - Row( - children: [ - Expanded( - child: DesktopActionButton( - title: MainActions.buyAction.name(context), - image: MainActions.buyAction.image, - canShow: MainActions.buyAction.canShow?.call(dashboardViewModel), - isEnabled: MainActions.buyAction.isEnabled?.call(dashboardViewModel), - onTap: () async => await MainActions.buyAction.onTap(context, dashboardViewModel), - ), - ), - Expanded( - child: DesktopActionButton( - title: MainActions.sellAction.name(context), - image: MainActions.sellAction.image, - canShow: MainActions.sellAction.canShow?.call(dashboardViewModel), - isEnabled: MainActions.sellAction.isEnabled?.call(dashboardViewModel), - onTap: () async => await MainActions.sellAction.onTap(context, dashboardViewModel), - ), - ), - ], - ), - ], + ); + } ); } } From 887afdadd002c7f73786b7c67ac5f49cfb23a811 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Fri, 10 Feb 2023 20:39:23 +0200 Subject: [PATCH 6/6] Change ionia welcome page animation --- lib/router.dart | 5 ++++- lib/src/widgets/market_place_item.dart | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/router.dart b/lib/router.dart index 83d247e76..0e0d82ff6 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -444,7 +444,10 @@ Route createRoute(RouteSettings settings) { )); case Routes.ioniaWelcomePage: - return CupertinoPageRoute(builder: (_) => getIt.get()); + return CupertinoPageRoute( + fullscreenDialog: true, + builder: (_) => getIt.get(), + ); case Routes.ioniaLoginPage: return CupertinoPageRoute( builder: (_) => getIt.get()); diff --git a/lib/src/widgets/market_place_item.dart b/lib/src/widgets/market_place_item.dart index 8b8963bbe..438391c97 100644 --- a/lib/src/widgets/market_place_item.dart +++ b/lib/src/widgets/market_place_item.dart @@ -15,8 +15,11 @@ class MarketPlaceItem extends StatelessWidget { @override Widget build(BuildContext context) { - return GestureDetector( + return InkWell( onTap: onTap, + hoverColor: Colors.transparent, + splashColor: Colors.transparent, + highlightColor: Colors.transparent, child: Stack( children: [ Container(