Articles in this section
Category / Section

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

1 min read

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>[];
    startTime: Duration(hours: 4, days: -1)),
    endTime: Duration(hours: 5, days: -1)),
    subject: 'Release Meeting',
    color: Colors.lightBlueAccent,
    startTime: Duration(hours: 2, days: -2)),
    endTime: Duration(hours: 4, days: -2)),
    subject: 'Performance check',
    color: Colors.amber,
    startTime: Duration(hours: 6, days: -3)),
    endTime: Duration(hours: 7, days: -3)),
    subject: 'Support',
    startTime: Duration(hours: 6, days: 2)),
    endTime: Duration(hours: 7, days: 2)),
    subject: 'Retrospective',
    color: Colors.purple,
  return _DataSource(appointments);

View sample in GitHub

height customization


Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied