In flutter, we want to overlay a dialog above the widget.
We were able to display the dialog after pushing the button.
However, we want to display that dialo
The issue you have its normal on Flutter so let's see the code.
I guess the problem is in the constructor for the Widget, need to be like this :
showMyDialog(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context){
return new AlertDialog(
content: Text(
'Message Here',
),
actions: [
FlatButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop(true);
},
),
],
);
}
);
}
Try this