-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Context passing around in StatelessWidget #23400
Comments
A stateless image is immutable, therefore no way to store the context anywhere when it becomes available. |
I guess you would point out a stateless widget is immutable instead of an stateless image |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Why do we have to pass the context around in a
StatelessWidget
?Improvement Question: Wouldn't it be better to allow also in a
StatlessWidget
thecontext
everywhere? Or do I miss some point?Bad example! Context needs to be passed around in a
StatelessWidget
.In a
StatefulWidget
it is also possible without passing the context around, because the context variable is accessable everywhere in the state. It's nice however why isn't it also possible in aStatelessWidget
?The text was updated successfully, but these errors were encountered: