macos_ui icon indicating copy to clipboard operation
macos_ui copied to clipboard

MacosWindowScope not available further down tree

Open jocubeit opened this issue 2 years ago • 1 comments

I'm trying to add sidebar toggling from a PlatformMenuItem, nested in a PlatformMenuGroup, nested in a PlatformMenuBar which is a child of MacosWindow.

I get the following error:

No MacosWindowScope found in context 'package:macos_ui/src/layout/window.dart'

It seems to MacosWindowScope is not present several widgets down the tree in the PlatformMenuItem.

I tried settings a GlobalKey for both MacosWindow, and the Sidebar widgets, but can't seem to access the isSidebarShown property nor the toggleSidebar() method.

I'm wondering how I can toggle the sidebar from a system menu provided by PlatformMenu.

jocubeit avatar Nov 30 '23 13:11 jocubeit

Closed this by accident, it's still an issue for me.

jocubeit avatar Dec 13 '23 07:12 jocubeit