The main takeaway from this recipe is the importance of proper widget tree construction. When you push a new route onto Navigator, you are essentially replacing every widget that lives underneath MaterialApp, as explained in this diagram:
If PlanProvider was a child of MaterialApp, it would be destroyed when pushing the new route, making all its data inaccessible to the next widget. If you have an InheritedWidget that only needs to provide data for a single screen, then placing it lower in the widget tree is optimal. However, if this same data needs to be accessed across multiple screens, it has to be placed above our Navigator.
Placing our global state widget at the root of the tree also has the added benefit of causing our app to update without any extra code. Try checking and unchecking a few tasks in your plans. You'll notice that the is data automatically updated, like magic. This is one of the primary benefits of maintaining a clean architecture in...