AlertDialogs are widgets that you use to give feedback or to ask for some information from your user. It is a small window that stays on top of the current screen, and only covers part of the user interface. Some use cases include asking for confirmation before deleting an item (Are you sure?), or giving some information to the user (Order completed!). In our code, we'll show our user the contact information of the Hello World Travel company.
Showing an AlertDialog widget requires a few steps:
- Calling the showDialog() method
- Setting context
- Setting builder
- Returning the AlertDialog property
- Setting the AlertDialog properties
Let's write a new method, called contactUs, at the end of the MyApp class:
void contactUs(BuildContext ...