-
Notifications
You must be signed in to change notification settings - Fork 237
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
Switch not switch the bool #110
Comments
Same error here |
Probably just not doing state management correctly. Is this code inside a StatefulWidget or StatelessWidget? If Stateful, you need to call setState when you change a value so that the widget gets rebuilt. |
Not solving the issue |
ok, i just miss understood the naming of the switchtile widgets. The name initialvalue , is the actual switch value. |
Could you explain your code?
|
Not sure what is wrong in your, code , seems good to me. I am using GetX package, which don't use statefull class to change states. try to move setState otside the widget tree:
|
Same here. Worked correctly with StatefulWidget, but not with Provider package. The build method doesn't seem to be called after notifyChanges().
|
They haven't solved this issue yet. |
I am also having problems with this. The below code does not toggle the widget. However, the print statement works and changes the variable once.
|
tried a simple switch, it stays always in initial value
The text was updated successfully, but these errors were encountered: