Skip to content

Selecting the 1st day of any month, did not update the UI #931

@Hakimi-Cyneox

Description

@Hakimi-Cyneox

Describe the bug

  • When i swipe to the next month, then tap to select the 1st day of month, the UI did not update the selected day. - Note that the date did captured and updated at the top box there.
  • The UI will update only when swipe to other month and return, and select other day then select the 1st day again.
  • If select other than the 1st day, will be no issue.

Im using Getx btw.

To reproduce
Please include a short code sample that can be used to reproduce the problem.

Obx(
                      () => Padding(
                    padding: EdgeInsets.all(4.w),
                    child: Card(
                      elevation: 5,
                      child: Padding(
                        padding: EdgeInsets.symmetric(horizontal: 4.w),
                        child: TableCalendar(
                          enabledDayPredicate: controller.isDateBlocked,
                          selectedDayPredicate: (day) {
                              return controller.selectedCheckInDate.value.year == day.year &&
                                  controller.selectedCheckInDate.value.month == day.month &&
                                  controller.selectedCheckInDate.value.day == day.day;
                          },
                          lastDay: DateTime.utc(2100, 1, 1),
                          firstDay: DateTime.now(),
                          focusedDay: controller.focusedCheckInDate.value,
                          calendarFormat: controller.calendarFormat.value,
                          onPageChanged: (focusedDay) {
                              controller.focusedCheckInDate.value = focusedDay;
                          },
                          headerStyle: const HeaderStyle(
                            formatButtonVisible : false,
                          ),
                          calendarStyle: CalendarStyle(
                            todayDecoration: const BoxDecoration(
                              shape: BoxShape.circle,
                              color: AppColors.caramel,
                            ),
                            markersAlignment: Alignment.bottomCenter,
                            markerDecoration: const BoxDecoration(
                              shape: BoxShape.circle,
                              color: AppColors.chineseYellow,
                            ),
                            selectedTextStyle: TextStyles.semiBold(
                                isStatic: true, color: AppColors.white)!,
                            selectedDecoration: const BoxDecoration(
                                color: AppColors.chineseYellow, shape: BoxShape.circle),
                          ),
                          onDaySelected: (selectedDay, focusedDay) {
                            controller.updateSelectedDate(selectedDay);
                            controller.selectedCheckInTimeSlot?.value = "";
                          },
                        ),
                      ),
                    ),
                  ),
                ),


void updateSelectedDate(DateTime date){
      selectedCheckInDate.value = date;
      focusedCheckInDate.value = date;
      timeSlots = generateTimeIntervals(timeInterval);
    refresh();
    update();
  }

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Screen.Recording.2026-01-30.at.10.00.58.AM.mov

Output of flutter doctor
Paste the result of this command here.

Output

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions