openDialog static method
Implementation
static Future<Null> openDialog(BuildContext context) async {
switch (await showDialog(
context: context,
builder: (BuildContext context) {
return SimpleDialog(
contentPadding:
EdgeInsets.only(left: 0.0, right: 0.0, top: 0.0, bottom: 0.0),
children: <Widget>[
Container(
color: themeColor,
margin: EdgeInsets.all(0.0),
padding: EdgeInsets.only(bottom: 10.0, top: 10.0),
height: 100.0,
child: Column(
children: <Widget>[
Container(
child: Icon(
Icons.exit_to_app,
size: 30.0,
color: Colors.white,
),
margin: EdgeInsets.only(bottom: 10.0),
),
ChatWidget.widgetShowText(
'Are you sure to exit app?', '', ''),
],
),
),
SimpleDialogOption(
onPressed: () {
Navigator.pop(context, 0);
},
child: Row(
children: <Widget>[
Container(
child: Icon(
Icons.cancel,
color: Colors.white70,
),
margin: EdgeInsets.only(right: 10.0),
),
ChatWidget.widgetShowText('Cancel', '', ''),
],
),
),
SimpleDialogOption(
onPressed: () {
Navigator.pop(context, 1);
},
child: Row(
children: <Widget>[
Container(
child: Icon(
Icons.check_circle,
color: Colors.white70,
),
margin: EdgeInsets.only(right: 10.0),
),
ChatWidget.widgetShowText('Yes', '', ''),
],
),
),
],
);
})) {
case 0:
break;
case 1:
exit(0);
break;
}
}