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 any 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 the GitHub sample here

height customization

 

Conclusion

I hope you enjoyed learning about how to customize the appointment height in schedule view of the Flutter Calendar.

You can refer to our Flutter Calendar feature tour page to know about its other groundbreaking feature representations. You can also explore our documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!


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