Summary
In this chapter, you’ve seen some of the basic concepts of state management in Flutter, while building an app called Master Plan. This app allows users to create plans and add tasks to each plan, and shows how to manage the app state across multiple screens.
In particular, we’ve covered the following topics:
- Model-view separation: you’ve seen the importance of separating the application’s data model from the view layer.
- By keeping the model and view separate, it’s easier to maintain and scale the app as it grows in size and complexity.
- In the
MasterPlanApp
, you used thePlan
andTask
classes as data models, and the widgets in the app acted as the view layer. - In the recipe Managing the data layer with InheritedWidget and InheritedNotifier, you added the
PlanProvider
class, which extendsInheritedNotifier
. - You used it to manage the app’s data layer. Using an
InheritedWidget
, you could access...