How to manually show/dismiss DropdownButton in flutter?

Viewed 1173

I need more flexibility in presenting/dismissing a DropdownButton's list of choices in flutter. I want to be able to show/hide DropdownButton as a result of some other user action than clicking on it. It doesn't seem these methods are exposed in the doc. What is a good way to do this?

1 Answers

There is a specific widget for this:

Visibility( visible: false, child: Container(color: Colors.blue, width: 100, height: 100), ),

Use visible to show or hide the widget, i.e isVisible().

Put whatever as a child, as example Column or Row.

Related