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 ...