How to use radio buttons inside popup menus?

Posted by Editorial Staff | Updated on

Want to use radio buttons inside popup menus? The problem is that the PopupMenuButton is maintaining the popup dialog as private state (it even pushes a new route onto the Navigator stack). Calling setState won’t rebuild the items. You can use an AnimatedBuilder and a ValueNotifier to get around this.

Here’s an example of a working radio button list inside a popup:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@] Your question and answer will appear on and help other developers.

Related Questions & Answers