We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the appointment height in schedule view of the Flutter Calendar


In the Flutter Event Calendar, you can customize the height of the appointment in schedule view using appointmentItemHeight property of the ScheduleViewSettings.

By using hideEmptyScheduleWeek property of the ScheduleViewSettings, you can hide the week doesn’t have appointments.

child: SfCalendar(
  view: CalendarView.schedule,
  dataSource: getCalendarDataSource(),
  scheduleViewSettings: ScheduleViewSettings(
      appointmentItemHeight: 70, hideEmptyScheduleWeek: true),
))));
 
_DataSource getCalendarDataSource() {
  final List<Appointment> appointments = <Appointment>[];
 
  appointments.add(Appointment(
    startTime: DateTime.now().add(const Duration(hours: 4, days: -1)),
    endTime: DateTime.now().add(const Duration(hours: 5, days: -1)),
    subject: 'Release Meeting',
    color: Colors.lightBlueAccent,
  ));
  appointments.add(Appointment(
    startTime: DateTime.now().add(const Duration(hours: 2, days: -2)),
    endTime: DateTime.now().add(const Duration(hours: 4, days: -2)),
    subject: 'Performance check',
    color: Colors.amber,
  ));
  appointments.add(Appointment(
    startTime: DateTime.now().add(const Duration(hours: 6, days: -3)),
    endTime: DateTime.now().add(const Duration(hours: 7, days: -3)),
    subject: 'Support',
    color: Colors.green,
  ));
  appointments.add(Appointment(
    startTime: DateTime.now().add(const Duration(hours: 6, days: 2)),
    endTime: DateTime.now().add(const Duration(hours: 7, days: 2)),
    subject: 'Retrospective',
    color: Colors.purple,
  ));
 
  return _DataSource(appointments);
}

View sample in GitHub

height customization

 

ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile