I have been trying to make a dialog popup when pressing a popupmenubutton, however it does not seem to work, I run the app in debug mode through chrome as my Laptop is unable to run in debug mode through androud studio emulator.
child: Scaffold(
resizeToAvoidBottomInset: true,
backgroundColor: Color.fromRGBO(31, 31, 47, 1),
appBar: AppBar(
actions: [
PopupMenuButton<String>(
padding: EdgeInsets.all(0),
onSelected: (value) {
print(value);
},
itemBuilder: (BuildContext context) {
return [
PopupMenuItem(
child: Text('Cancel'),
onTap: () {BackdropFilter(
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
child: Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15.0)),
backgroundColor: Color(Color.getAlphaFromOpacity(0.5)),
child: _dialogContent(),
)
);
},
),
];
},
),
], ),
Widget _dialogContent() {return SimpleDialog(
title: Text('Enter Cancel Code'),
children: <Widget>[
// TextFormField()
ElevatedButton(
onPressed: () => Navigator.pop(context, false),
child: Text('Okay')),
],);}
}