cake_wallet/lib/view_model/dashboard/desktop_sidebar_view_model.dart
Godwin Asuquo b974458f1b
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>
2023-07-11 19:07:46 +03:00

34 lines
634 B
Dart

import 'package:mobx/mobx.dart';
part 'desktop_sidebar_view_model.g.dart';
enum SidebarItem {
dashboard,
transactions,
support,
settings,
}
class DesktopSidebarViewModel = DesktopSidebarViewModelBase with _$DesktopSidebarViewModel;
abstract class DesktopSidebarViewModelBase with Store {
DesktopSidebarViewModelBase();
@observable
SidebarItem currentPage = SidebarItem.dashboard;
@action
void onPageChange(SidebarItem item) {
if (currentPage == item) {
resetSidebar();
return;
}
currentPage = item;
}
@action
void resetSidebar() {
currentPage = SidebarItem.dashboard;
}
}