Flutter: How to make a popup menu FAST (PopupMenuButton)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
To make a menu that looks like this  you just need to use a PopupMenuButton. And inside it pass to itemBuilder a  function returning a list of PopupMenuItems. Now here's an odd part, those menu items don't   work like regular buttons where you  would pass for example an onTap, it all works sort of like a drop  down where pop menu button receives   a type which then gets returned  by menu items when they're tapped. To be honest it seems to me like  not a very intuitive choice. Anyway what I recommend doing to  get around that is to create an   enum with all the possible  actions accessible from that menu, then to pass that enum to the PopupMenuButton and   pass the proper enum values  to each of the menu items. Then pass to onSelected parameter a function where   you use a switch to determine  which button has been pressed. And... seems like it's working. you
Info
Channel: krawieck
Views: 10,606
Rating: undefined out of 5
Keywords: flutter, tutorial, mobile app, how to, popup menu, PopupMenuButton, PopupMenuItem, web dev, dev, coding, dropdown, drop down
Id: ca7_sAtexXY
Channel Id: undefined
Length: 1min 27sec (87 seconds)
Published: Fri May 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.