-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Under what circumstances would I want to attach my context to the InheritedWidget #1
Comments
Hi Larry, I saw your message in the blog but I'm a little bit busier than usual these days. Anyway, I think it's better to ask here so everyone can participate and suggest changes or improvements. Regarding your question, if you refer to the Flutter documentation about the InheredtedWidget you can see the following:
Pay special attention to the second paragraph. Also, from the inheritFromWidgetOfExactType docs:
So basically, if you use If you use ancestorInheritedElementForWidgetOfExactType this won't happen. It's that simple. So if you want your widgets to get rebuilt once the |
I see now, thanks for the clarification. The flutter docs, which are very good, were a bit confusing to me in this instance; for example, when saying:
I wasn't quite sure what this build context and that widget were referring to. Was 'that widget' the InheritedWidget or my own, for example? I suspected the former but really couldn't tell for sure. Appreciate the assist! |
My apologies, but opening an issue appears to be the only way I can ask a question. Your library is much appreciated but I was wondering when I might want to attach my context to the InheritedWidget vs not. Are there advantages to using inheritFromWidgetOfExactType vs ancestorInheritedElementForWidgetOfExactType under certain circumstances?
The text was updated successfully, but these errors were encountered: