Interview frequency: …
Short answer
An InheritedWidget shares a value across the tree, and didChangeDependencies notifies the State when a dependency it registered through the context changes.
Explanation
Use it for a shared value that changes over time such as Theme or locale, and register the read in build or didChangeDependencies. Do not make an InheritedWidget a global store for all state; keep its scope clear and use specialized APIs as the requirements grow.
Common mistakes
- Reading a dependency in initState only even though it may change.
- Passing all the app's data through one huge InheritedWidget.