xxxxxxxxxx
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: new Text("Alert!!"),
content: new Text("You are awesome!"),
actions: <Widget>[
new FlatButton(
child: new Text("OK"),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
xxxxxxxxxx
AlertDialog(
title: const Text('AlertDialog Title'),
content: const Text('this is a demo alert diolog'),
actions: <Widget>[
TextButton(
child: const Text('Approve'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
xxxxxxxxxx
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(32.0))),
xxxxxxxxxx
showAlertDialog(BuildContext context) {
// set up the button
Widget okButton = FlatButton(
child: Text("OK"),
onPressed: () { },
);
// set up the AlertDialog
AlertDialog alert = AlertDialog(
title: Text("My title"),
content: Text("This is my message."),
actions: [
okButton,
],
);
// show the dialog
showDialog(
context: context,
builder: (BuildContext context) {
return alert;
},
);
}
xxxxxxxxxx
// This is just to render a CircularProgressIndication in center of the screen using Getx Dialog
Get.dialog(Center(
child: SizedBox.square(
dimension: 100,
child: Container(
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20), color: red),
child: Center(
child: CircularProgressIndicator(
strokeWidth: 6,
color: Colors.blue,
backgroundColor: white,
),
),
),
),
));
xxxxxxxxxx
shape: CircleBorder(),
shape: RoundedRectangleBorder(),
shape: ContinuousRectangleBorder(),
shape: BeveledRectangleBorder(),