After the user has swiped away the item,
remove the item from the list and display a snackbar.
In a real app, you might need to perform more complex logic,
such as removing the item from a web service or database.

Update the itemBuilder() function to return a Dismissible widget:

3. Provide “leave behind” indicators

As it stands,
the app allows users to swipe items off the list, but it doesn’t
give a visual indication of what happens when they do.
To provide a cue that items are removed,
display a “leave behind” indicator as they
swipe the item off the screen. In this case,
the indicator is a red background.

To add the indicator,
provide a background parameter to the Dismissible.

lib/{step2.dart (Dismissible) → main.dart (Dismissible)}

@@ -16,6 +16,8 @@