Summary
This was a long chapter, detailing the most important and feature-rich implementations of state management techniques. We have learned four major state management techniques and their concepts and created our counter example application using all of them sequentially. The following major points can be taken away from this chapter:
- Provider is an extension and a wrapper over the
InheritedWidget
class, which uses.of(context)
to access the states down the widget hierarchy. - Riverpod is an enhanced version of Provider, where performance and flexibility were improved and a compile-safe feature was introduced.
- We studied BLoC – a different paradigm of state management that works on streams, events, and states. It is a widely used technique and decouples our UI from our business logic.
- Lastly, we studied Cubit, which is a subset of BLoC with no events and with simplified code inside the Cubit class.
In the next chapter, we will be studying state...