-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Flutter Cookbook
By :
One phrase that is thrown around a lot in the Flutter community is “Lift State Up.” This mantra refers to the idea that State objects should be placed higher than the widgets that need it in the widget tree. Our InheritedWidget, which we created in the previous recipe, now works perfectly for a single screen, but what happens when you add a second?
In this recipe, you are going to add another screen to the Master Plan app so that you can create multiple plans. Accomplishing this will require our State provider to be lifted higher in the tree, closer to its root.
You should have completed the previous recipes in this chapter before following along with this one.
Let’s add a second screen to the app and lift the State higher in the tree:
PlanProvider class so that it can handle multiple plans. Change the type of ValueNotifier every time...