I'm using table_calendar from Flutter and when I select a day in another month, the calendar resets it's view to the current month again. I don't want this to happen.
Example: Today is 28 of March. I go to the May month and select a day there. Now, the calendar view goes back to March automatically.
But I still need to mark, on the calendar, which day is today.
Here's my calendar now:
TableCalendar(
calendarFormat: _calendarFormat,
firstDay: DateTime.utc(2010, 10, 16),
lastDay: DateTime.utc(2030, 3, 14),
focusedDay: DateTime.now(),
selectedDayPredicate: (day) {
return isSameDay(_selectedDay, day);
},
onDaySelected: (selectedDay, focusedDay) {
setState(() {
_selectedDay = selectedDay;
_focusedDay = focusedDay;
context.read<Counter>().modify(_focusedDay);
});
},
onFormatChanged: (format) {
setState(() {
_calendarFormat = format;
});
},
onPageChanged: (focusedDay) {
_focusedDay = focusedDay;
},
)