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(); final sideMenu = SideMenuController();
@override @override
void initState() { void initState() {
SideMenuGlobal.controller = sideMenu;
sideMenu.addListener((p0) { sideMenu.addListener((p0) {
page.jumpToPage(p0); page.jumpToPage(p0);
}); });
@ -73,7 +74,6 @@ class _DashboardPageState extends State<DashboardPage> {
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
SideMenu( SideMenu(
controller: sideMenu,
topItems: [ topItems: [
SideMenuItem( SideMenuItem(
iconPath: 'assets/images/wallet_outline.png', iconPath: 'assets/images/wallet_outline.png',
@ -243,7 +243,7 @@ class _DashboardPage extends BasePage {
dotHeight: 6.0, dotHeight: 6.0,
dotColor: Theme.of(context).indicatorColor, dotColor: Theme.of(context).indicatorColor,
activeDotColor: activeDotColor:
Theme.of(context).accentTextTheme!.headline4!.backgroundColor!), Theme.of(context).accentTextTheme.headline4!.backgroundColor!),
)), )),
Observer(builder: (_) { Observer(builder: (_) {
return ClipRect( 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:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar/side_menu_item.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -6,17 +5,13 @@ class SideMenu extends StatelessWidget {
const SideMenu({ const SideMenu({
super.key, super.key,
required this.topItems, required this.topItems,
required this.controller,
required this.bottomItems, required this.bottomItems,
}); });
final List<SideMenuItem> topItems; final List<SideMenuItem> topItems;
final List<SideMenuItem> bottomItems; final List<SideMenuItem> bottomItems;
final SideMenuController controller;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
SideMenuGlobal.controller = controller;
return Container( return Container(
color: Colors.black.withOpacity(0.1), color: Colors.black.withOpacity(0.1),
width: 76, width: 76,