You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to disable the dragging of the Switch ? #24857
Now there is a switch in our app to show a shop is open or closed in my App, it will show a dialog to confirm when I tap it , but if I drag the switch from On to Off , and then I close the dialog ,the switch should remain On, but it becomes Off , so I want to disable the dragging ,is it possible?
@carlosbdw Not sure if you still need this but I ran into 0 finds on my search for this problem. So, I'm posting for others that might be asking the same question.
You could remove onChanged of your Switch and wrap it with a GestureDetector. Ignore color values... You might need to take in consideration of Theme.of(context).brightness to add necessary conditions of thumb and track color. Please refer to switch.dart.
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 flutter doctor -v and a minimal reproduction of the issue.
Activity
zoechi commentedon Nov 29, 2018
Please consider asking support questions in one of the other channels listed at http://flutter.io/support .
I'd suggest to ask on StackOverflow but please add some code that demonstrates what you try to accomplish.
erdemyerebasmaz commentedon Dec 4, 2019
@carlosbdw Not sure if you still need this but I ran into 0 finds on my search for this problem. So, I'm posting for others that might be asking the same question.
You could remove onChanged of your Switch and wrap it with a GestureDetector.
Ignore color values... You might need to take in consideration of Theme.of(context).brightness to add necessary conditions of thumb and track color. Please refer to switch.dart.
github-actions commentedon Aug 25, 2021
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
flutter doctor -vand a minimal reproduction of the issue.