You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the use case?
A popup doesn't show automagically, it only shows when you call showDialog or similar, so you can notify yourself.
I need to transform the button from '+' to '×' when the button is click
Thanks, Maybe i can use the showMenu, This issue is talk about menu, the dialog cann't calculate the position where to locate
By the way, I see the PopupMenu is vertical only, Is there common pop widget that can be use to custom my child like PopWindow of android. Maybe I need to write by myself. /(ㄒoㄒ)/~~ @zanderso
We also have a use-case that requires the onShowPopupMenu() function: We want to be able to log the activity when the user taps the button to show the menu.
Currently this isn't possible to check because the showMenu call is burried inside _PopupMenuButtonState.showButtonMenu()
Any updates on this issue? I have a case where I need to change the UI if the popup menu is open. Since it does provide onCanceled, it would be nice to have onShow functionality.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
zoechi commentedon Sep 13, 2018
What is the use case?
A popup doesn't show automagically, it only shows when you call
showDialogor similar, so you can notify yourself.zhangjianlin77 commentedon Sep 13, 2018
https://github.com/flutter/flutter/blob/d927c9331005f81157fa39dff7b5dab415ad330b/packages/flutter/lib/src/material/popup_menu.dart
the 'showButtonMenu' function is written in the _PopupMenuButtonState, and I can't know when the PopupMenu is appeared
zhangjianlin77 commentedon Sep 13, 2018
zhangjianlin77 commentedon Sep 13, 2018
Do you mean I call the showMenu to custom my menu?
zoechi commentedon Sep 13, 2018
Your code somewhere calls
showDialog(). This code can notify about the dialog showing.zhangjianlin77 commentedon Sep 13, 2018
Thanks, Maybe i can use the showMenu, This issue is talk about menu, the dialog cann't calculate the position where to locate
By the way, I see the PopupMenu is vertical only, Is there common pop widget that can be use to custom my child like PopWindow of android. Maybe I need to write by myself. /(ㄒoㄒ)/~~
@zanderso
egramond commentedon Oct 12, 2018
We also have a use-case that requires the onShowPopupMenu() function: We want to be able to log the activity when the user taps the button to show the menu.
Currently this isn't possible to check because the showMenu call is burried inside _PopupMenuButtonState.showButtonMenu()
popiosifcristian commentedon Jul 31, 2020
Any updates on this issue? I have a case where I need to change the UI if the popup menu is open. Since it does provide onCanceled, it would be nice to have onShow functionality.
eugenioamato commentedon Jul 31, 2020
To achieve this you could fork the material package PopupMenuButton class inside
flutter/lib/src/material/popup_menu.dart
to accept one new callback Function
this.onSelected, this.onCanceled, this.onShowMenu,<----then added a new typedef
typedef PopupMenuShown=void Function();<------declare it as
final PopupMenuShown onShowMenu;then add a call to the callback at the end of showButtonMenu() method
line 1086:
widget.onShowMenu();after it's possible to add this prop in the creation of the widget
PopupMenuButton( itemBuilder:..., onSelected: ....., onShowMenu: ...,. <-----github-actions commentedon Aug 28, 2022
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.