rwbr / flutter_neat_and_clean_calendar

Simple and clean flutter calendar with ability to slide up/down to show weekly/monthly calendar. Forked from [flutter_clean_calender](https://pub.dev/packages/flutter_clean_calendar)
MIT License
104 stars 51 forks source link

Tapping "Today" button doesn't do anything when viewing previous months #69

Closed deffs closed 1 month ago

deffs commented 8 months ago

When using the calendar and toggling to previous months the "Today" button above the month name doesn't work properly as no navigation to the current date happens. I.e. current month is January then toggling back to December and tapping "Today" doesn't do anything (calendar freezes). Toggling to future months and tapping "Today" works properly.

rwbr commented 8 months ago

I can't reproduce this problem. You need to give me more context to understand your problem.

If I run the example app of the package, it works as expected. Tapping-Today-Button

Are you using the example? Can you reproduce your problem with the example app?

deffs commented 8 months ago

Looks like this is due to me not setting onMonthChanged in my Calendar definition. If I delete the onMonthChanged property from my declaration or I set it as null it throws an exception when I go to previous months and tap the "Today" button. If I set it to (value) {} it works fine.

Same issue with onDateSelected. When trying to tap on a date in a future month.

This is the workaround that works for me:

image
rwbr commented 8 months ago

Ok, I understand. Thank you. I'll find a way to fix this.

rwbr commented 8 months ago

I can't reproduce this problem in the example app. Even when I set these callback parameters to null, everything works as expected. Did you try this in the example? What's the difference between the example and your code?

deffs commented 7 months ago

It's possible that it could be my Flutter version as I'm still on 3.13.6, but haven't had time to test this.

rwbr commented 1 month ago

I have no idea, what goes wrong there. I close this one