This chapter covers
- StatefulWidget and the state object
- Widget tree vs. element tree
- State object lifecycle
- InheritedWidget and blocs for state management
- Introduction to streams and async Dart
This chapter is going to be my favorite for two reasons: first, there isn’t one approach to state management (in Flutter or elsewhere). There are many different state management patterns, and all developers have opinions about each of them. And second, developers (including myself) are ... passionate ... about their opinions.
With that in mind, I won’t be able to do a deep dive on every state management pattern that’s popular right now. I thought a lot about which patterns I should cover, and I came up with this two-pronged litmus test to decide:
- Will it help you expand your Flutter and Dart skills?
- Is it unopinionated enough that its concepts can be applied elsewhere?