aleksanderwozniak / table_calendar

Highly customizable, feature-packed calendar widget for Flutter
Apache License 2.0
1.84k stars 1k forks source link

Swipe day to another day #870

Closed Somtobro closed 6 months ago

Somtobro commented 7 months ago

I understand there was a controller in the previous versions to achieve this, now it seems in achievable .may be me not seeing the way to go about it. I tried pageview builder and then adding or removing a day proceeding to update the ui. But this approach can't work because it doesn't account for the 31st ..it's gonna to to 32.

I believe there's a way to do it and im not seeing it.would appreciate you all help.thanks

Somtobro commented 6 months ago

Thanks guys I've fixed it. I came up with a very brilliant solution. I wrapped the body around a Swipe widget and I used the flutters add and subtract to go back and forth to the next or previous (changing selected and focused days) day that handles it perfectly as it checks if the the next day exists and if it's the last day of the year it goes to the new year as well. Thanks once more