I have the following AlertDialog
.
showDialog(
context: context,
child: new AlertDialog(
title: const Text("Location disabled"),
content: const Text(
"""
Location is disabled on this device. Please enable it and try again.
"""),
actions: [
new FlatButton(
child: const Text("Ok"),
onPressed: _dismissDialog,
),
],
),
);
How can I make _dismissDialog()
dismiss said AlertDialog
?
worked for me, but the Flutter Team's gallery contains an example using:
which also works, and I am tempted to follow their lead.
Use
Navigator.pop(context);
Example