Fix bug on sidebar reset

This commit is contained in:
Godwin Asuquo 2023-02-08 18:56:00 +02:00
parent 3f03fb0b18
commit a1abdc849a
2 changed files with 2 additions and 7 deletions

View file

@ -49,6 +49,7 @@ class _DashboardPageState extends State<DashboardPage> {
final sideMenu = SideMenuController();
@override
void initState() {
SideMenuGlobal.controller = sideMenu;
sideMenu.addListener((p0) {
page.jumpToPage(p0);
});
@ -73,7 +74,6 @@ class _DashboardPageState extends State<DashboardPage> {
mainAxisAlignment: MainAxisAlignment.start,
children: [
SideMenu(
controller: sideMenu,
topItems: [
SideMenuItem(
iconPath: 'assets/images/wallet_outline.png',
@ -243,7 +243,7 @@ class _DashboardPage extends BasePage {
dotHeight: 6.0,
dotColor: Theme.of(context).indicatorColor,
activeDotColor:
Theme.of(context).accentTextTheme!.headline4!.backgroundColor!),
Theme.of(context).accentTextTheme.headline4!.backgroundColor!),
)),
Observer(builder: (_) {
return ClipRect(

View file

@ -1,4 +1,3 @@
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:flutter/material.dart';
@ -6,17 +5,13 @@ class SideMenu extends StatelessWidget {
const SideMenu({
super.key,
required this.topItems,
required this.controller,
required this.bottomItems,
});
final List<SideMenuItem> topItems;
final List<SideMenuItem> bottomItems;
final SideMenuController controller;
@override
Widget build(BuildContext context) {
SideMenuGlobal.controller = controller;
return Container(
color: Colors.black.withOpacity(0.1),
width: 76,