AlertDialog show the alert box as the javascript alert works
it will prompt dialogbox from showDialog , in that we use AlertDialog which have title , content , and actions .
title : title should be title of the AlertDialog
content : content will be the content of the AlertDialog
actions :action can be button which can be used to trigger actions
Padding(
padding: EdgeInsets.only(right: 20.0),
child: GestureDetector(
onTap: () {
showDialog(
context: context,
builder: (ctx) => AlertDialog(
title: Text('This is test'),
content: Text('This is test so dont worry '),
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(ctx).pop();
},
child: Text("okay"),
),
],
));
},
child: Icon(
Icons.search,
size: 26.0,
),
)),