Inserting and editing data

We now need to allow our users to insert new data and edit or delete existing records in the database. Both the insert and edit functions require some UI that can contain the text that the user types, and for that, we'll use dialog boxes, which are ideal when you need some information from the user, and then come back to the caller when they are finished.

So, we'll create two new files, one for the ShoppingList and one for the ListItems. We'll call these shopping_list_dialog.dart and list_item_dialog.dart. We'll place both in the ui folder of the app.

Let's begin with the shopping_list_dialog.dart file. What we want to achieve here is showing our user a dialog window that allows them to insert or edit a ShoppingList ...

Get Flutter Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.