macosui / macos_ui

Flutter widgets and themes implementing the current macOS design language.
https://macosui.github.io/macos_ui/#/
MIT License
1.87k stars 182 forks source link

Sidebar with bottom #311

Closed anilcngz closed 1 year ago

anilcngz commented 2 years ago

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

Screen Shot 2022-10-15 at 13 19 12
Yetispapa commented 1 year ago

@anilcngz, did you manage to find a solution?

GroovinChip commented 1 year ago

@anilcngz This is expected behavior IMO. I think if you want to display a settings page when the bottom is clicked you should push a new route, one that doesn't contain a sidebar.

anilcngz commented 1 year ago

@GroovinChip Attached you can find the App Store app screenshot, it has a very similar design. When I click the bottom item, it behaves like side bar item.

Screenshot 2023-01-16 at 10 34 20

GroovinChip commented 1 year ago

@GroovinChip Attached you can find the App Store app screenshot, it has a very similar design. When I click the bottom item, it behaves like side bar item.

Screenshot 2023-01-16 at 10 34 20

Apple unfortunately do not consistently follow their own guidelines across their app. Do you know of any other Apple (or other) apps that have this behavior on macOS?

anilcngz commented 1 year ago

I was using rize.io for a while, it also has a similar experience. But I couldn't find any other Apple (or other) apps with a bottom Menu Item.

If it's like this in the Apple guideline as you said, we can close this issue.

Screenshot 2023-01-22 at 22 48 44
GroovinChip commented 1 year ago

I was using rize.io for a while, it also has a similar experience. But I couldn't find any other Apple (or other) apps with a bottom Menu Item.

If it's like this in the Apple guideline as you said, we can close this issue.

Screenshot 2023-01-22 at 22 48 44

That looks like a custom sidebar, not an Apple-guidelines sidebar. In fact, the guidelines don't appear to mention this paradigm at all. So IMO the bottom should not be used to perform navigation to a view that a SidebarItem is connected to.