Flutter appBar:
Scaffold(
appBar : AppBar(
actions: [IconButton1 IconButton2 ... IconButtonN]
),
body:
);
IconButton1 IconButton2 ... IconButtonN
In a narrow screen, the list of icon buttons will overflow. How to make the list of overflowed buttons into a popup menu automatically?
IconButton1 IconButton2 PopupMenuButton
Item1
Item2
...
ItemN
You can use
MediaQuery.of(context).size.widthto get the device width and conditionally render the icon buttons directly, or create aPopupMenuButtonthat displays the icon buttons in a popup menu.Like this: