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 e8fa54b49..ad2291ba5 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_dashboard_actions.dart @@ -14,72 +14,75 @@ class DesktopDashboardActions extends StatelessWidget { @override Widget build(BuildContext context) { - return Observer( - builder: (_) { - 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( - 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), - ), - ), - ], - ), - Expanded( - child: MarketPlacePage( - dashboardViewModel: dashboardViewModel, - marketPlaceViewModel: getIt.get(), + return Container( + color: Theme.of(context).colorScheme.background, + child: Observer( + builder: (_) { + 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( + 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), + ), + ), + ], + ), + Expanded( + child: MarketPlacePage( + dashboardViewModel: dashboardViewModel, + marketPlaceViewModel: getIt.get(), + ), + ), + ], + ); + } + ), ); } } 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 31348aed4..c08b80785 100644 --- a/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart +++ b/lib/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart @@ -77,27 +77,21 @@ class DesktopSidebarWrapper extends BasePage { SideMenuItem( imagePath: 'assets/images/wallet_outline.png', isSelected: desktopSidebarViewModel.currentPage == SidebarItem.dashboard, - onTap: () => desktopSidebarViewModel.onPageChange(SidebarItem.dashboard), + onTap: () { + desktopSidebarViewModel.onPageChange(SidebarItem.dashboard); + desktopNavigatorKey.currentState + ?.pushNamedAndRemoveUntil(Routes.desktop_actions, (route) => false); + }, ), SideMenuItem( onTap: () { - String? currentPath; - - desktopNavigatorKey.currentState?.popUntil((route) { - currentPath = route.settings.name; - return true; - }); - - switch (currentPath) { - case Routes.transactionsPage: - desktopSidebarViewModel.resetSidebar(); - break; - default: - desktopSidebarViewModel.resetSidebar(); - Future.delayed(Duration(milliseconds: 10), () { - desktopSidebarViewModel.onPageChange(SidebarItem.transactions); - desktopNavigatorKey.currentState?.pushNamed(Routes.transactionsPage); - }); + if (desktopSidebarViewModel.currentPage == SidebarItem.transactions) { + desktopNavigatorKey.currentState + ?.pushNamedAndRemoveUntil(Routes.desktop_actions, (route) => false); + desktopSidebarViewModel.resetSidebar(); + } else { + desktopSidebarViewModel.onPageChange(SidebarItem.transactions); + desktopNavigatorKey.currentState?.pushNamed(Routes.transactionsPage); } }, isSelected: desktopSidebarViewModel.currentPage == SidebarItem.transactions, @@ -156,20 +150,11 @@ class DesktopSidebarWrapper extends BasePage { void _setEffects() async { reaction((_) => desktopSidebarViewModel.currentPage, (page) { - String? currentPath; - - desktopNavigatorKey.currentState?.popUntil((route) { - currentPath = route.settings.name; - return true; - }); - if (page == SidebarItem.transactions) { + if (page == SidebarItem.dashboard) { + pageController.jumpToPage(0); return; } - - if (currentPath == Routes.transactionsPage) { - Navigator.of(desktopNavigatorKey.currentContext!).pop(); - } - pageController.jumpToPage(page.index); + pageController.jumpToPage(page.index - 1); }); } } diff --git a/lib/src/screens/dashboard/widgets/balance_page.dart b/lib/src/screens/dashboard/widgets/balance_page.dart index 789fa4a03..617481f95 100644 --- a/lib/src/screens/dashboard/widgets/balance_page.dart +++ b/lib/src/screens/dashboard/widgets/balance_page.dart @@ -16,9 +16,6 @@ class BalancePage extends StatelessWidget { final DashboardViewModel dashboardViewModel; final SettingsStore settingsStore; - Color get backgroundLightColor => - settingsStore.currentTheme.type == ThemeType.bright ? Colors.transparent : Colors.white; - @override Widget build(BuildContext context) { return GestureDetector( diff --git a/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart b/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart index c49644d7c..c568761b9 100644 --- a/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart +++ b/lib/src/screens/new_wallet/advanced_privacy_settings_page.dart @@ -118,19 +118,21 @@ class _AdvancedPrivacySettingsBodyState extends State SizedBox( + width: constraints.maxWidth * 0.8, + child: Text( + S.of(context).settings_can_be_changed_later, + textAlign: TextAlign.center, + style: TextStyle( + color: Theme.of(context) .accentTextTheme! .displayMedium! .color, + ), ), ), - ), + ) ], ), ), diff --git a/lib/src/screens/nodes/node_create_or_edit_page.dart b/lib/src/screens/nodes/node_create_or_edit_page.dart index 71f615c6a..ddce52774 100644 --- a/lib/src/screens/nodes/node_create_or_edit_page.dart +++ b/lib/src/screens/nodes/node_create_or_edit_page.dart @@ -115,6 +115,7 @@ class NodeCreateOrEditPage extends BasePage { bottomSectionPadding: EdgeInsets.only(bottom: 24), bottomSection: Observer( builder: (_) => Row( + mainAxisAlignment: MainAxisAlignment.center, children: [ Flexible( child: Container( diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index 69e92d530..87e2cee4c 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -145,15 +145,13 @@ abstract class SettingsStoreBase with Store { }); } - reaction( - (_) => disableBuy, - (bool disableBuy) => sharedPreferences.setBool( - PreferencesKey.disableBuyKey, disableBuy)); + reaction((_) => disableBuy, + (bool disableBuy) => sharedPreferences.setBool(PreferencesKey.disableBuyKey, disableBuy)); reaction( (_) => disableSell, - (bool disableSell) => sharedPreferences.setBool( - PreferencesKey.disableSellKey, disableSell)); + (bool disableSell) => + sharedPreferences.setBool(PreferencesKey.disableSellKey, disableSell)); reaction( (_) => fiatApiMode, @@ -350,12 +348,9 @@ abstract class SettingsStoreBase with Store { // FIX-ME: Check for which default value we should have here final shouldSaveRecipientAddress = sharedPreferences.getBool(PreferencesKey.shouldSaveRecipientAddressKey) ?? false; - final isAppSecure = - sharedPreferences.getBool(PreferencesKey.isAppSecureKey) ?? false; - final disableBuy = - sharedPreferences.getBool(PreferencesKey.disableBuyKey) ?? false; - final disableSell = - sharedPreferences.getBool(PreferencesKey.disableSellKey) ?? false; + final isAppSecure = sharedPreferences.getBool(PreferencesKey.isAppSecureKey) ?? false; + final disableBuy = sharedPreferences.getBool(PreferencesKey.disableBuyKey) ?? false; + final disableSell = sharedPreferences.getBool(PreferencesKey.disableSellKey) ?? false; final currentFiatApiMode = FiatApiMode.deserialize( raw: sharedPreferences.getInt(PreferencesKey.currentFiatApiModeKey) ?? FiatApiMode.enabled.raw); @@ -487,16 +482,14 @@ abstract class SettingsStoreBase with Store { useTOTP2FA = sharedPreferences.getBool(PreferencesKey.useTOTP2FA) ?? useTOTP2FA; numberOfFailedTokenTrials = sharedPreferences.getInt(PreferencesKey.failedTotpTokenTrials) ?? numberOfFailedTokenTrials; - sharedPreferences.getBool(PreferencesKey.shouldSaveRecipientAddressKey) ?? shouldSaveRecipientAddress; - isAppSecure = - sharedPreferences.getBool(PreferencesKey.isAppSecureKey) ?? isAppSecure; - disableBuy = - sharedPreferences.getBool(PreferencesKey.disableBuyKey) ?? disableBuy; - disableSell = - sharedPreferences.getBool(PreferencesKey.disableSellKey) ?? disableSell; - allowBiometricalAuthentication = sharedPreferences - .getBool(PreferencesKey.allowBiometricalAuthenticationKey) ?? - allowBiometricalAuthentication; + sharedPreferences.getBool(PreferencesKey.shouldSaveRecipientAddressKey) ?? + shouldSaveRecipientAddress; + isAppSecure = sharedPreferences.getBool(PreferencesKey.isAppSecureKey) ?? isAppSecure; + disableBuy = sharedPreferences.getBool(PreferencesKey.disableBuyKey) ?? disableBuy; + disableSell = sharedPreferences.getBool(PreferencesKey.disableSellKey) ?? disableSell; + allowBiometricalAuthentication = + sharedPreferences.getBool(PreferencesKey.allowBiometricalAuthenticationKey) ?? + allowBiometricalAuthentication; shouldShowMarketPlaceInDashboard = sharedPreferences.getBool(PreferencesKey.shouldShowMarketPlaceInDashboard) ?? shouldShowMarketPlaceInDashboard; diff --git a/lib/view_model/dashboard/desktop_sidebar_view_model.dart b/lib/view_model/dashboard/desktop_sidebar_view_model.dart index d0320c05f..543b44b35 100644 --- a/lib/view_model/dashboard/desktop_sidebar_view_model.dart +++ b/lib/view_model/dashboard/desktop_sidebar_view_model.dart @@ -4,9 +4,9 @@ part 'desktop_sidebar_view_model.g.dart'; enum SidebarItem { dashboard, + transactions, support, settings, - transactions; } class DesktopSidebarViewModel = DesktopSidebarViewModelBase with _$DesktopSidebarViewModel; diff --git a/macos/Podfile.lock b/macos/Podfile.lock index 9c79281a1..2ccdc183c 100644 --- a/macos/Podfile.lock +++ b/macos/Podfile.lock @@ -115,10 +115,10 @@ SPEC CHECKSUMS: platform_device_id_macos: f763bb55f088be804d61b96eb4710b8ab6598e94 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 share_plus_macos: 853ee48e7dce06b633998ca0735d482dd671ade4 - shared_preferences_foundation: e2dae3258e06f44cc55f49d42024fd8dd03c590c + shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 url_launcher_macos: 5335912b679c073563f29d89d33d10d459f95451 wakelock_macos: bc3f2a9bd8d2e6c89fee1e1822e7ddac3bd004a9 PODFILE CHECKSUM: 5107934592df7813b33d744aebc8ddc6b5a5445f -COCOAPODS: 1.11.3 +COCOAPODS: 1.12.1