[skip ci] reformat desktop dashboard

This commit is contained in:
Godwin Asuquo 2023-02-08 21:57:26 +02:00
parent b1b8193043
commit 48ae156eb8

View file

@ -15,8 +15,7 @@ class DesktopDashboardView extends StatefulWidget {
} }
class _DesktopDashboardViewState extends State<DesktopDashboardView> { class _DesktopDashboardViewState extends State<DesktopDashboardView> {
final page = PageController();
final page = PageController();
final sideMenu = SideMenuController(); final sideMenu = SideMenuController();
@override @override
void initState() { void initState() {
@ -26,70 +25,64 @@ class _DesktopDashboardViewState extends State<DesktopDashboardView> {
}); });
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SideMenu( SideMenu(
topItems: [ topItems: [
SideMenuItem( SideMenuItem(
iconPath: 'assets/images/wallet_outline.png', iconPath: 'assets/images/wallet_outline.png',
priority: 0, priority: 0,
onTap: (page, _) => sideMenu.changePage(page), onTap: (page, _) => sideMenu.changePage(page),
),
],
bottomItems: [
SideMenuItem(
iconPath: 'assets/images/support_icon.png',
priority: 1,
onTap: (page, _)
=> sideMenu.changePage(page),
),
SideMenuItem(
iconPath: 'assets/images/settings_outline.png',
priority: 2,
onTap: (page, _) =>
sideMenu.changePage(page)
,
),
],
), ),
Expanded( ],
child: PageView( bottomItems: [
controller: page, SideMenuItem(
physics: NeverScrollableScrollPhysics(), iconPath: 'assets/images/support_icon.png',
children: [ priority: 1,
_DashboardPage( onTap: (page, _) => sideMenu.changePage(page),
balancePage: widget.balancePage,
),
Container(
child: Navigator(
initialRoute: Routes.support,
onGenerateRoute: (settings) => Router.createRoute(settings),
onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {
return [
navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!
];
},
),
),
Navigator(
initialRoute: Routes.desktop_settings_page,
onGenerateRoute: (settings) => Router.createRoute(settings),
onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {
return [
navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!
];
},
),
],
),
), ),
SideMenuItem(
iconPath: 'assets/images/settings_outline.png',
priority: 2,
onTap: (page, _) => sideMenu.changePage(page),
),
],
),
Expanded(
child: PageView(
controller: page,
physics: NeverScrollableScrollPhysics(),
children: [
_DashboardPage(
balancePage: widget.balancePage,
),
Container(
child: Navigator(
initialRoute: Routes.support,
onGenerateRoute: (settings) => Router.createRoute(settings),
onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {
return [
navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!
];
},
),
),
Navigator(
initialRoute: Routes.desktop_settings_page,
onGenerateRoute: (settings) => Router.createRoute(settings),
onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {
return [
navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!
];
},
),
],
),
),
], ],
); );
} }
@ -105,19 +98,17 @@ class _DashboardPage extends StatelessWidget {
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(flex: 3, child: balancePage),
flex: 3, Expanded(
child: balancePage), flex: 5,
Expanded( child: Navigator(
flex: 5, initialRoute: Routes.desktop_actions,
child: Navigator( onGenerateRoute: (settings) => Router.createRoute(settings),
initialRoute: Routes.desktop_actions, onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) {
onGenerateRoute: (settings) => Router.createRoute(settings), return [navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!];
onGenerateInitialRoutes: (NavigatorState navigator, String initialRouteName) { },
return [navigator.widget.onGenerateRoute!(RouteSettings(name: initialRouteName))!];
},
), ),
), ),
], ],
); );
} }