macos_ui
macos_ui copied to clipboard
Sidebar with bottom
Use case
There is no way to unselect a SideBarItem because we need to provide a currentIndex (It must be in the range of 0 to [items.length]). I think because of that when I add a Settings page by using bottom property as below and click on it, still SideBarItem is shown as selected.
MacosWindow(
sidebar: Sidebar(
top: const Text('LOGO'),
minWidth: 200,
builder: (context, _) => SidebarItems(
currentIndex: _currentIndex,
items: items,
itemSize: SidebarItemSize.large,
onChanged: (index) => _onItemTapped(context, index),
),
bottom: MacosListTile(
leading: const MacosIcon(CupertinoIcons.profile_circled),
title: const Text('Settings'),
subtitle: Text(userEmail ?? ''),
onClick: () => context.go('/settings'),
),
),
child: widget.child,
)
Proposal