I am working with a PopupMnuButton. The PopupMenuButton is
skined so the selected value is not visible. The menu has four
items which when clicked performs respective operations. But when
the main button of the PopupMenuButton is clicked it performs the
operation for the first menu item. I wish to stop that from
Going through the help files I found that PopupMenuButton
dispatches a click event when the main button part of the
PopupMenuButton is clicked, which further dispatches the itemClick
event for the last selected index.
Is there a way around to stop the click event from firing
when the main button is clicked?
I dont want any action to take place if the button is
clicked. The user has to select an item from the menu.
No setting selectedIndex value to -1 did no work as
slectedIndex is a private property for PopupMenuButton so can't
access from the application. Whenever, I try clicking the button it
fires the itemClick. Even could not get the standard change event
to work....it seems that only itemClick method operates and the
click on button fires the itemclick event.
It would be great if anyone could suggest any workaround.