How to add rounded border for PopupMenu in Flutter?
Another simple way is:
shape: ContinuousRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
You just add like this at PopupMenuButton
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
),
Example
PopupMenuButton(
child: Text("Show Popup Menu"),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15.0))
),
itemBuilder: (context) => [
PopupMenuItem(
child: Text("pub.dev"),
),
PopupMenuItem(
child: Text("Flutter"),
),
PopupMenuItem(
child: Text("Google.com"),
),
PopupMenuItem(
child: Text("https://blogdeveloperspot.blogspot.com"),
),
],
),
Adding to the answer given by @Taz You can use themes to have settings for rounded corners in each and every Popups at one place:
MaterialApp(
// ....
theme: ThemeData(
// ....
popupMenuTheme: PopupMenuThemeData(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8))
)
)