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
Whenever the user changes the calendar date, something should happen in my program. At least a class I created to store my screen's data should change. In order to do so, I'm calling a method that changes the internal data and then calling notifyListeners() to update other fields. However, if I use notifyListeners(), the selected date on the calendar doesn't change; the data does change, but not the selected rectangle on the screen.
To Reproduce
The code in my app is quite long, but I believe the following should suffice...
Why is the selected rectangle not being selected? I've also tried to refactor the code to use the Provider package instead of setState() but it didn't work either.
Desktop (please complete the following information):
OS: Windows 10
Browser: Firefox
Smartphone (please complete the following information):
Device: Nexus 6
OS: Android 9.0
The text was updated successfully, but these errors were encountered:
I'm leaning more and more on blaming the interaction of setState and notifyListeners. After wrapping the Container from the DatePickerTimeline widget source code and replacing widget.currentDate by a Consumer<> with data.currentDate (and adding notifyListeners), everything seems to work fine.
Describe the bug
Whenever the user changes the calendar date, something should happen in my program. At least a class I created to store my screen's data should change. In order to do so, I'm calling a method that changes the internal data and then calling
notifyListeners()
to update other fields. However, if I usenotifyListeners()
, the selected date on the calendar doesn't change; the data does change, but not the selected rectangle on the screen.To Reproduce
The code in my app is quite long, but I believe the following should suffice...
The
DatePickerTimeline
call:The method to update the data is something like:
Expected behavior
Why is the selected rectangle not being selected? I've also tried to refactor the code to use the
Provider
package instead ofsetState()
but it didn't work either.Desktop (please complete the following information):
Smartphone (please complete the following information):
The text was updated successfully, but these errors were encountered: