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

SidebarItem with disclosureItems and leading widget places disclosure turn-down widget after leading widget #268

Closed slewallen closed 2 years ago

slewallen commented 2 years ago

Description

On Mac OS, an outline view item with disclosure items places the disclosure turn-down before any icon for the outline view item. However, macos_ui is placing the leading icon before the turn-down icon.

See attached screenshot comparing what macos_ui is doing in comparison to actual Mac OS.

Steps To Reproduce

Modify the example at "https://pub.dev/packages/macos_ui/example" to include a leading widget for the Disclosure SidebarItem as such:

            SidebarItem(
              label: Text('Disclosure'),
              leading: MacosIcon(CupertinoIcons.alarm),
              disclosureItems: [
                SidebarItem(
                  leading: MacosIcon(CupertinoIcons.infinite),
                  label: Text('Colors'),
                ),
                SidebarItem(
                  leading: MacosIcon(CupertinoIcons.infinite),
                  label: Text('Item 3'),
                ),
              ],
            ),

Notice that the order is incorrect. For a correct example, see Mac OS Finder or Mac OS Mail.

Expected behavior

Order of disclosure turn-down and leading widget should be reversed. When a SidebarItem has disclosure items and a leading widget along with a label, it should be displayed as: "> 😀 Label" instead of "😀 > Label" in sidebar item.

Screenshots

Comparision of macos_ui and actual Mac OS
GroovinChip commented 2 years ago

@whiplashoo what do you think about this? It looks like the current implementation is indeed incorrect, but I need to verify.

whiplashoo commented 2 years ago

Yes, indeed, I also see it in Finder or Disk Utility:

Screenshot 2022-06-30 at 11 40 49 PM
GroovinChip commented 2 years ago

Alrighty then, I'll whip up a fix. Thanks for reporting this @slewallen