Thanks to visit codestin.com
Credit goes to github.com

Skip to content

On week view the last column last 2 rows don't show appointment if you start from them #2347

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Kennouche-H opened this issue May 2, 2025 · 1 comment
Labels
calendar Calendar component waiting for customer response Cannot make further progress until the customer responds.

Comments

@Kennouche-H
Copy link

Bug description

If you give a source that has appointments that start from anywhere other than weirdly exactly the last 2 lines from last column they appear with no issues; even if the pass threw it, but if i start from those 2 cells they won't appear until next day.

on the first pic i made an appointment from 22:30 to 00:00 and as you can see it worked
second i made an appointment each 30 min so from 22:30 to 23:00 then from 23:00 to 23:30 ...and as you can see no data shows
on last 2 pics i made an appointment from 23:00 to 4:00 and as you can see it only shows from 00:00 to 23:00

on the list that has the data, its not missing its there but the calendar doesn't show specifically those 2 cells.

Steps to reproduce

1 . create a sfcalendar with week view with 30min separation.
2 . create appointments at the last day of the week at the last 2 cells (23:00 - 23:30)
3 . nothing appears

Code sample

Code sample
Container(
                              width: MediaQuery.sizeOf(context).width - 200,
                              height: 500,
                              padding: EdgeInsets.all(10),
                              decoration: BoxDecoration(
                                borderRadius: const BorderRadius.all(Radius.circular(20)),
                                boxShadow: [
                                  const BoxShadow(color: Colors.black54),
                                  BoxShadow(color: Colors.white, spreadRadius: -5, blurRadius: 5, offset: Offset.fromDirection(1, 5)),
                                ],
                              ),
                              child: c.SfCalendar(
                                initialDisplayDate: startday,
                                cellEndPadding: 0,
                                view: c.CalendarView.week,
                                firstDayOfWeek: DateTime.now().weekday,
                                onViewChanged: (dates) async {
                                  if (dates.visibleDates.first != startday) {
                                    startday = dates.visibleDates.first;
                                    await getdata();
                                  }
                                },
                                headerStyle: c.CalendarHeaderStyle(
                                  textAlign: TextAlign.center,
                                  backgroundColor: Colors.transparent,
                                  textStyle: const TextStyle(color: Colors.black87, fontWeight: FontWeight.bold),
                                ),
                                viewHeaderStyle: c.ViewHeaderStyle(
                                  dateTextStyle: const TextStyle(color: Colors.black87, fontWeight: FontWeight.bold),
                                  dayTextStyle: const TextStyle(color: Colors.black87, fontWeight: FontWeight.bold),
                                ),
                                blackoutDatesTextStyle: const TextStyle(color: Colors.black87, fontWeight: FontWeight.bold),
                                appointmentBuilder: (context, calendarAppointmentDetails) {
                                  return Container(
                                    alignment: Alignment.center,
                                    decoration: BoxDecoration(color: Colors.grey, borderRadius: const BorderRadius.all(Radius.circular(5))),
                                    child: Text(
                                      " ${calendarAppointmentDetails.appointments.first.name} ${DateFormat.Hm().format(calendarAppointmentDetails.appointments.first.from)}-${DateFormat.Hm().format(calendarAppointmentDetails.appointments.first.to)}",
                                      style: const TextStyle(color: Colors.black87, fontWeight: FontWeight.bold),
                                      textAlign: TextAlign.center,
                                    ),
                                  );
                                },
                                dataSource: ReservationDataSource(reservations),
                                timeSlotViewSettings: c.TimeSlotViewSettings(
                                  timeFormat: 'H:mm',
                                  timeIntervalHeight: 20,
                                  timeInterval: const Duration(minutes: 30),
                                  timeTextStyle: const TextStyle(fontSize: 11, color: Colors.black87, fontWeight: FontWeight.bold),
                                ),
                                onTap: (calendarTapDetails) {
                                  if (calendarTapDetails.appointments == null) {
                                    selectedreserve = -1;
                                    account = -1;
                                    dates.text = DateFormat.yMMMd().format(calendarTapDetails.date!);
                                    hours.text = DateFormat.Hm().format(calendarTapDetails.date!);
                                    datee.text = DateFormat.yMMMd().format(calendarTapDetails.date!.add(Duration(minutes: 30)));
                                    houre.text = DateFormat.Hm().format(calendarTapDetails.date!.add(Duration(minutes: 30)));

                                    setState(() {});
                                  } else {
                                    selectedreserve = calendarTapDetails.appointments?.first.id;
                                    account = calendarTapDetails.appointments?.first.acc;
                                    dates.text = DateFormat.yMMMd().format(calendarTapDetails.appointments?.first.from);
                                    hours.text = DateFormat.Hm().format(calendarTapDetails.appointments?.first.from);
                                    datee.text = DateFormat.yMMMd().format(calendarTapDetails.appointments?.first.to);
                                    houre.text = DateFormat.Hm().format(calendarTapDetails.appointments?.first.to);

                                    setState(() {});
                                  }
                                },
                              ),
                            ),
class ReservationDataSource extends c.CalendarDataSource {
  ReservationDataSource(List<Reservation> source) {
    appointments = source;
  }

  @override
  DateTime getStartTime(int index) {
    return appointments![index].from;
  }

  @override
  DateTime getEndTime(int index) {
    return appointments![index].to;
  }

  @override
  bool isAllDay(int index) {
    return appointments![index].isAllDay;
  }
}

class Reservation {
  Reservation(this.id, this.acc, this.name, this.from, this.to);

  var id;
  var acc;
  var name;
  var from;
  var to;
  bool isAllDay = false;
}

Screenshots or Video

Screenshots / Video demonstration

Image

Image

Image

Image

Stack Traces

Stack Traces
[Add the Stack Traces here]

On which target platforms have you observed this bug?

Windows

Flutter Doctor output

Doctor output
[√] Flutter (Channel stable, 3.29.3, on Microsoft Windows [Version 10.0.19045.5796], locale en-US) [1,290ms]
    • Flutter version 3.29.3 on channel stable at C:\Users\Hoceine\AppData\Local\Flutter\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision ea121f8859 (3 weeks ago), 2025-04-11 19:10:07 +0000
    • Engine revision cf56914b32
    • Dart version 3.7.2
    • DevTools version 2.42.3

[√] Windows Version (10 Pro 64-bit, 22H2, 2009) [8.7s]

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.1) [20.3s]
    • Android SDK at C:\Users\Hoceine\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.1
    • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.4+-12508038-b607.1)
    • All Android licenses accepted.

[√] Chrome - develop for the web [435ms]
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.12.2) [431ms]
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.12.35521.163
    • Windows 10 SDK version 10.0.22621.0

[√] Android Studio (version 2024.2) [137ms]
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.4+-12508038-b607.1)

[√] VS Code (version 1.99.3) [130ms]
    • VS Code at C:\Users\Hoceine\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.110.0

[√] Connected device (3 available) [1,628ms]
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19045.5796]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 135.0.7049.115
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 135.0.3179.85

[√] Network resources [1,712ms]
    • All expected network resources are available.

• No issues found!
@LavanyaGowtham2021 LavanyaGowtham2021 added calendar Calendar component open Open labels May 5, 2025
@Mugunthan-Ramalingam
Copy link
Contributor

Hi @Kennouche-H,

We have checked the shared code snippet with SfCalendar using version 29.1.41. However, we were unable to reproduce the issue on our end. Please check the attached sample, and if you are still experiencing the issue, we request that you replicate it in the attached sample and provide us with more details regarding the specific scenario in which you are encountering this issue. This will help us to assist you more effectively.

Demo:

Image

Sample: gh_2347.zip

Regards,
Mugunthan.

@LavanyaGowtham2021 LavanyaGowtham2021 added waiting for customer response Cannot make further progress until the customer responds. and removed open Open labels May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
calendar Calendar component waiting for customer response Cannot make further progress until the customer responds.
Projects
None yet
Development

No branches or pull requests

3 participants