General process of implementing the bloc pattern:
- Model for Todo Items (the data we’ll be using)
- States representing the loading process for the To-do list; are they loading, loaded, or unable to be loaded?
- Events representing the operations done on the To-do list; these are for each of the operations we are going to be doing in the app.
- The Bloc class; extending a Bloc, it takes in the Events from step 3 and maps them to the proper states in step 4.
The Equatable package and class make it easier to use the == and hashCode functions without having to manually override them yourself.
You can have multiple blocs, each handling different aspects of the app (eg. TodosBloc handles CRUD with the todos, FilteredTodosBloc controls which of those todos we can see based on our filtering criteria).
A BlocDelegate tracks the events, transitions, and errors among the various blocs.
Here is an article describing some operators for dart. It helps a lot to understand the code in the tutorial.
What not to commit in Dart (but mostly applies to flutter too). Long story short, just commit your lib and pubspec.yaml.