Category / Section
How to autofit the calendar to screen height in the Flutter Calendar
1 min read
In the Flutter Event Calendar, you can autofit the calendar time intervals to screen height by using the timeIntervalHeight property value as -1 of the TimeSlotViewSettings.
import 'package:flutter/material.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart'; void main() => runApp(AutoFitCalendar()); class AutoFitCalendar extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, home: Scaffold( body: SafeArea( child: SfCalendar( view: CalendarView.day, allowedViews: <CalendarView>[ CalendarView.day, CalendarView.week, CalendarView.workWeek ], timeSlotViewSettings: TimeSlotViewSettings(timeIntervalHeight: -1), )))); } }
Day view
| Week view
| Work week view
|