The way Flutter handles dialogs is fascinating in terms of its simplicity. Dialogs are just routes. The only difference between a MaterialPageRoute and a Dialog is the animation that Flutter uses to display them. Since dialogs are just routes, they use the same Navigator API for pushing and popping. This is accomplished by calling the showDialog or showCupertinoDialog global function. Both of these functions will look for the app's Navigator and push a route onto the navigation stack using the platform-appropriate animation.
An alert, whether Material or Cupertino, is made up of three components:
- Title
- Content
- Actions
The title and content properties are just widgets. Typically, you would use a Text widget, but that's not required. If you want to put an input form and a scrolling list in a Center widget, you could certainly do that.
The actions are also usually a list of buttons, where...