CrudTodo Model
Explore how to build and manage the CrudTodo model to enable create, read, update, and delete operations on todo items within a Flutter app. Understand the integration of Firebase Firestore and authentication, and how to notify UI components of data changes effectively.
In this lesson, we’ll write our CrudTodo class. It is also mixin with the ChangeNotifier class so that we have the notifyListeners method to notify the observers of the CrudTodo class. This class has only one state variable, which is _taskItemsMap. This is a map in which the key is the date and the value is a list of todo items.
Code
Let’s look at the code below: