I’ve been trying to find a solution for this problem to no avail.
Is there a way in flutter (currently running version 3.22.2) to programatically close an opened DropdownMenu , ie. closing the dropdown as a reaction to something external, not via a user tap?
I’ve tried various methods, Including Navigator.pop(context)
with a GlobalKey
, but it seems that underneath the Hood DropdownMenu is using overlays to show the dropdown items, and doing a pop simply closes any window the dropdown currently resides in.
For my specific use case, I would like to close the dropdown menu whenever Android users preses the system back button.
Thank you for all your help!