dropdown_button2 icon indicating copy to clipboard operation
dropdown_button2 copied to clipboard

Using DropdownButton2 above the Navigator

Open Skyggedans opened this issue 1 year ago • 0 comments

Hi, I'm trying to use the DropdownButton2 in some global main menu inside builder() method of MaterialApp, therefore it's located under the MaterialApp but above the Navigator, so is unable to find the Navigator inside context and crashes. Before switching to DropdownButton2 I used a regular Material showMenu() that allowed me to get the GoRouter instance with Riverpod, and use its navigatorKey to obtain the correct Navigator context and pass it as context param, like this: showMenu<int>(context: router.configuration.navigatorKey.currentContext ?? context, ...); Please consider adding a possibility to override the context in some similar way.

Skyggedans avatar Jan 14 '24 10:01 Skyggedans