I have a PopupMenuButton, and after opening that I want the background to be blurred or darken such that focus will be on the newly opened menu.
return Scaffold(
appbar: AppBar(
//....
leading: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: PopupMenuButton<String>(
color: kLightGreen,
offset: Offset(30, 30),
icon: Icon(
Icons.sort,
color: kLightestGreen,
),
onSelected: choiceAction,
itemBuilder: (BuildContext context) {
return Constants.choices.map((String choice) {
return PopupMenuItem<String>(
value: choice,
child: Text(
choice,
textAlign: TextAlign.left,
style: TextStyle(color: Colors.white),
),
);
}).toList();
},
),
),
//...
)
)