-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
Change visible range dynamically #60
Comments
Hey, Awesome lib! |
I was able to solve this with just rebuilding timetable widget with a different controller instance |
Having two different controller instances doesn't solve it to me, could you please explain how you solved it? @TatsuUkraine thanks! |
so I have an enum that represents all my range variants, Statefull widget that creates controller in initState and renders timetable itself. In the constructor it receives enum value. Then in didUpdateWidget this stateful widget checks if the enum is changed, and if so - disposes prev controller and creates a new one with a different visible range |
@javieralcantara sorry, don't pay attention to my prev comment)) I looked at different package))) in timetable - I'm changing value key for this Statefull widget each time range is changing. This leads to destroy widget with prev range and creating a new range from the scratch |
but I'm going to change this behavior to a variant with didUpdateWidget (at least I will try)) |
I apologize if the feature is already available, but I couldn't find a way to make it work.
I want to give the user the option between 4 visible ranges. 1, 3, 5 and week.
But, the grid does not update after that and keeps the first used VisibleRange (example: if when I created the controller I used VisibleRange.days(5) it always maintain a grid with 5 columns)
My controller code is as follows:
Below are some screenshots.
Thanks in advance.
![Screenshot_1606842184](https://user-images.githubusercontent.com/6534624/100772183-11d72200-33de-11eb-9ef7-31567ec715f7.png)
![Screenshot_1606842182](https://user-images.githubusercontent.com/6534624/100772189-13a0e580-33de-11eb-9bc1-5894cfbab10f.png)
![Screenshot_1606842179](https://user-images.githubusercontent.com/6534624/100772191-14397c00-33de-11eb-8bbe-dc064a510491.png)
![Screenshot_1606842176](https://user-images.githubusercontent.com/6534624/100772192-14397c00-33de-11eb-9f2a-0cc3ef0bb704.png)
![Screenshot_1606842173](https://user-images.githubusercontent.com/6534624/100772197-14d21280-33de-11eb-86a7-56f6177fd561.png)
The text was updated successfully, but these errors were encountered: