-
Notifications
You must be signed in to change notification settings - Fork 49
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
on change function is being called on load #2
Comments
I had the same issue and found two solutions.. however, the second one destroyed the drag of a DraggableBottomSheet I have in my app.. So i stuck to the first one 1 - just wrap the onChanged function with WidgetsBinding as such :
2- the other method is to use SchedulerBinding :
|
Incase you'd like to see where i found those solutions : |
Thanks @Bader-Al , I will look into that! |
I just made a PR to solve this issue. |
Thank you so much |
I was having the same problem what i did was add an if condition inside the _determine() function (as it is called during initState) |
when the widget loads, the state is false, and therefore unintended calls are being made on the app. Is there a way to isolate the on tap function only. I only want the calls to be made when a user taps the widget, not on load. Thank you.
The text was updated successfully, but these errors were encountered: