Challenge #1: Modify the “Delete” Toast
Follow the instructions to modify the delete toast in this challenge.
We'll cover the following
Problem statement
The toast notification we added to indicate that a student was deleted from the roster positions itself at the top of the screen, stays for 3000 ms (3 seconds), and then vanishes. It cannot be manually dismissed by the user. Sometimes, it can be a little hard to see in its default color and position. Your challenge is to fix that.
-
Change the duration of the toast to 5 seconds.
-
Add a close button so the user can close the toast sooner. Toast buttons are configured the same way that Action Sheet buttons are. Hint: use a role rather than a handler.
-
Move the toast to the bottom or middle of the screen using its position attribute.
-
Change its color.
Coding exercise
The application we have so far is provided below. Write your code solution where you feel necessary to complete the challenge. It is recommended that you try solving the exercise yourself before viewing the solution in the next lesson.
Get hands-on with 1200+ tech skills courses.