Challenge – completing the Items Screen functionality

At this time, the second screen in our app lists the items that are available in the items table in the database, but we have no way to insert, delete, or update items in the table. Basically, the steps required to complete the implementation are the same as those you already performed for the ShoppingList, with a few tweaks. As a challenge and a useful exercise, I recommend you try to implement those features yourself.

The steps required to complete this challenge are as follows:

  1. Create the UI that will allow the user to insert and update items, as shown in the following screenshot: 

  1. Add a trailing edit IconButton to the ListTile, to allow the user to edit an existing item.
  2. Add a FAB to the items screen, to allow the user to insert a new item.
  3. Create a function in the DBHelper class, called deleteItem(), that deletes the ListItem that's passed as an argument.
  4. Add a Dismissable widget that allows the user to delete an existing item.
  5. Test the functionalities you've just added to make sure they work correctly.

In the next section, you'll find the completed solution in case you want to have a look at the final implementation of the app to check your code or for a little help during the exercise.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.245.1