mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
CW-349 MacOS UI issue when navigating to Transaction details screen (#921)
* Fix macos ui issues when navigatng to transaction detail screen * [skip ci] remove print and indent * Refactor previous approach based on PR review * Code Enhancements * Fix transaction page navigation * Fix disable secure app request for macos * Update background color * Update background color * Update background color * Remove unrelated format * Fix navigation UI glitch --------- Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
OmarHatem
parent
bf0c2c8f35
commit
b974458f1b
@@ -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<MarketPlaceViewModel>(),
|
||||
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<MarketPlaceViewModel>(),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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<SidebarItem>((_) => 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);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -118,19 +118,21 @@ class _AdvancedPrivacySettingsBodyState extends State<AdvancedPrivacySettingsBod
|
||||
textColor: Colors.white,
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: MediaQuery.of(context).size.width * 0.15),
|
||||
child: Text(
|
||||
S.of(context).settings_can_be_changed_later,
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(
|
||||
color: Theme.of(context)
|
||||
LayoutBuilder(
|
||||
builder: (_, constraints) => 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,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
@@ -115,6 +115,7 @@ class NodeCreateOrEditPage extends BasePage {
|
||||
bottomSectionPadding: EdgeInsets.only(bottom: 24),
|
||||
bottomSection: Observer(
|
||||
builder: (_) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: <Widget>[
|
||||
Flexible(
|
||||
child: Container(
|
||||
|
||||
Reference in New Issue
Block a user