To show an alert, you must have to call showDialog() function, which contains the context and itemBuilder function . The itemBuilder function returns an object of type dialog, the AlertDialog. Now, run the app, it will give the following output. When you click on the button Show Alert, you will get the alert message.
Read moreHow do you make dialogue in Flutter?
Flutter simple Alert Dialog Adding simple Dialog to your screen in pretty easy in Flutter. Before adding Dialog you must call showDialog function to change current screen state to show the intermediate Dialog popup . In here we use AlertDialog widget to show simple Dialog with title and some text in the body.
Read more