werner-scholtz / kalender

An elegantly crafted Flutter calendar UI package.
MIT License
108 stars 29 forks source link

Switching from Week view to Day view #28

Closed hami-sh closed 8 months ago

hami-sh commented 9 months ago

Hey, great widget, love how customisable it is!

I have the example code running on my phone and the browser. When I switch from Week view to Day view, the correct day number is loaded however the previous day's events are shown until i swipe away to the next day, when it is properly set.

This happens as well in my own code! Calling setState doesnt help.

Could you try and fix this in the next version, or show me whats wrong and I can fix it?

werner-scholtz commented 9 months ago

Hi, I remember in the development of the package I had a few issues like that not sure why it is happening to you, are you able to replicate it on the web demo here https://werner-scholtz.github.io/kalender/ ?

hami-sh commented 9 months ago

Yeah, am able to recreate it. check the video below. Its the 18th of Feb for me in Australia. When I switch from week to day view, it shows the events for the 17th of Feb, but the date in the top corner remains the same. When I then navigate to the next page, the correct events are shown and the date in the top doesnt update.

https://github.com/werner-scholtz/kalender/assets/18391419/f441cf2e-b8e3-454f-8f2c-66d518f5a1a7

hami-sh commented 9 months ago

Just noticed as well that on the Day view, when I use controller.animateToDate(DateTime.now()) it goes to Saturday 17th of feb (the day before my current day)?

Seems to be related

hami-sh commented 9 months ago

OK -- fixed it. By using DayConfiguration rather than

CustomMultiDayConfiguration(
      name: 'Day',
      numberOfDays: 1,
)

It works perfectly. I think you have an off-by-one error somewhere!

Thanks!

werner-scholtz commented 9 months ago

Hi thanks for the video and info, I will investigate and resolve this asap.

werner-scholtz commented 9 months ago

OK -- fixed it. By using DayConfiguration rather than

CustomMultiDayConfiguration(
      name: 'Day',
      numberOfDays: 1,
)

It works perfectly. I think you have an off-by-one error somewhere!

Thanks!

Just want to confirm that the issue is specific to using the CustomMultiDayConfiguration like this.

werner-scholtz commented 9 months ago

I think this is be related to #32

werner-scholtz commented 8 months ago

Hi this should be fixed now.