Alerts and Dialogs

Alerts and Dialogs are a way to show a message to the user and ask for their response.

Projects

1. Login Dialog

Build a Welcome UI that has two buttons that says Login and Signup. When Login button is pressed show a dialog that has two text fields for username and password and two buttons for Login and Cancel. When Login button is pressed show a message “Welcome [Username]”. Cancel button should hide the dialog. Similarly, when Signup button is pressed show a dialog that has three text fields for name, username and password and two buttons for Signup and Cancel. When Signup button is pressed show a message “Welcome [name]”. Cancel button should hide the dialog.

Note: Separate the UI logic into different widgets and use them in the main widget.

2. Profile Data Dialog

Update the Profile Form project from previous lesson, so that when the user presses the Continue button, a dialog is shown with all the data entered by the user. The dialog should have a Close button that closes the dialog.

Resources