Monday 5 April 2021

Alert Dialog in flutter

 Alert Dialog in flutter

 new IconButton(
icon: new Icon(Icons.cloud_download_rounded),
highlightColor: Colors.orange,
iconSize: 30,
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) {
return getDialogBox();
});
},
),

method of AlertDialog 
AlertDialog getDialogBox() {
return AlertDialog(
title: Row(children: [
new IconButton(
icon: new Icon(Icons.warning_amber_outlined),
color: Colors.black45,
highlightColor: Colors.orange,
iconSize: 30,
onPressed: () {
showDialog(
context: context,
builder: (BuildContext context) {
return getDialogBox();
});
},
),
/* Image.network(
'https://flutter-examples.com/wp-content/uploads/2019/12/android_icon.png',
width: 50,
height: 50,
fit: BoxFit.contain,
),*/
Text(' Download ')
]),
content: Text("Are You Sure Want To Proceed?"),
actions: <Widget>[
TextButton(
child: Text("YES"),
onPressed: () {
//Put your code here which you want to execute on Yes button click.
Navigator.of(context).pop();
},
),
TextButton(
child:
Text("CANCEL"),
onPressed: () {
//Put your code here which you want to execute on Cancel button click.
Navigator.of(context).pop();
},
),
],
);
}

1 comment:

  1. Fantastic beat ! I wish to apprentice while you amend your web site, how could i subscribe for a blog site? The account aided me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided bright clear idea. imac service berlin

    ReplyDelete