Widget

build

BuildContext

context

return

ContentWidget

importantState

);

As widget trees get deeper, however, passing state information up and down the
tree hierarchy becomes cumbersome. So, a third widget type,
InheritedWidget,
provides an easy way to grab data from a shared ancestor. You can use
InheritedWidget to create a state widget that wraps a common ancestor in the
widget tree, as shown in this example:

Whenever one of the ExamWidget or GradeWidget objects needs data from
StudentState, it can now access it with a command such as:

final

studentState

StudentState

of

context

);