-
Notifications
You must be signed in to change notification settings - Fork 48
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
Calendar disappears with setState #18
Comments
Hi! I tried your code in the example project. All is good. |
I do have the same issue. On setState or when I perform a hot reload, the CalendarWeek widget disappears completely. Only if I navigate to a different screen and return back, the widget shows up again. I put the CalenderWeek widget inside a SliverAppBar in a CustomScrollView. Here is a code example:
Would be appreciated, if someone can check if they can reproduce the issue. I couldn't find anything in my code, what could be the culprit of this error. I also do not get any errors on the console. Flutter Version: 2.0.5 |
i have similar issue |
I was having the same issue and when I tried running the example app it was fine. I eventually boiled it down to an controller issue in my code. When I removed the controller property it was working as expected. I initial copied over from the example where CalendarWeek(
controller: CalendarWeekController(),
...
) is set which does not give an immediate error but once I either removed the controller property or intialized the controller like in the example app it was working just fine. final CalendarWeekController _controller = CalendarWeekController();
...
CalendarWeek(
controller: _controller,
...
) Hope this helps out others who might stumble upon this problem in the future. Great plugin btw! Wish to see more styling options of the entire date column like rearrange of day title and the date, other day shapes etc. |
I'm using the
onWeekChanged
event to add some logic & update some variables and if I use the setState function within this event, the calendar disappears. Firstly I thought it was due to my code, but it doesn't seem.The text was updated successfully, but these errors were encountered: