-
Hi, I am new to Flutter, and I'm trying to work with Tabs. I took an example and tried to add a ToggleSwitch, but I can't understand why it doesn't change its state when clicked. Could you please provide an example where we can add some widgets inside these tabs? Thanks. |
Beta Was this translation helpful? Give feedback.
Answered by
bdlukaa
Sep 4, 2024
Replies: 1 comment 2 replies
-
You can see the toggle switch example here |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try to wrap the
body
of the page in aStatefulBuilder
. Essentially, since the tabs are not rebuilt when the parent is rebuilt, their state remains the same - which means you need a stateful widget on the body of the tab to be updated.