Syncfusion Flutter Calendar & Date Range Picker
This skill covers two related Syncfusion Flutter components for date and calendar functionality: SfCalendar (Event Calendar) and SfDateRangePicker (Date Range Picker). While they share many visual and configuration features, they serve different primary purposes.
When to Use This Skill
Use this skill when you need to:
- Implement event calendars with appointments, scheduling, and time management
- Add date selection to forms, filters, or booking interfaces
- Display calendar views (month, week, day, year, decade, timeline, schedule)
- Handle date range selection for reports, analytics, or filtering
- Create appointment/booking systems with recurring events and time zones
- Build scheduling interfaces with drag-drop, resizing, and resource views
- Enable date navigation with various view modes and restrictions
- Customize calendar appearance with builders, themes, and styling
- Support multiple date selection modes (single, multiple, range, multi-range)
- Integrate calendar localization with RTL support and accessibility
Choosing the Right Component
Use SfCalendar (Event Calendar) when:
- You need to display and manage appointments/events
- Your app requires scheduling functionality (booking, meetings, tasks)
- You need timeline views or schedule views for event management
- Time-based views are important (day, week, workweek with time slots)
- You need recurring events, time zones, or resource allocation
- Drag-and-drop or appointment resizing is required
- Building calendars for: meeting schedulers, appointment books, task managers, event planners
Use SfDateRangePicker (Date Range Picker) when:
- You need date selection without appointment management
- Your primary goal is picking dates or date ranges for forms/filters
- You need flexible selection modes (single, multiple, range, multi-range)
- Simplified date input for booking start/end dates, report periods, etc.
- You want action buttons (confirm/cancel) for date selection dialogs
- Building UI for: date filters, booking dates, report date ranges, form date inputs
Key Differences Summary:
| Feature |
SfCalendar |
SfDateRangePicker |
| Primary Purpose |
Event scheduling & display |
Date selection |
| Appointments/Events |
✅ Full support |
❌ Not supported |
| View Types |
9 views (day, week, timeline, etc.) |
4 views (month, year, decade, century) |
| Selection Modes |
Single date/time slot |
Single, multiple, range, multi-range |
| Time Slots |
✅ Yes (with time) |
❌ Dates only |
| Action Buttons |
❌ No |
✅ Confirm/Cancel buttons |
| Recurring Events |
✅ Yes |
❌ No |
| Time Zones |
✅ Yes |
❌ No |
| Resource View |
✅ Yes |
❌ No |
| Drag & Drop |
✅ Yes |
❌ No |
Documentation and Navigation Guide
Getting Started
📄 Read: references/getting-started.md
- Installation and package setup for both components
- Basic SfCalendar implementation
- Basic SfDateRangePicker implementation
- Package dependencies and imports
- Quick comparison and first examples
Component Overview
📄 For Calendar: references/calendar-overview.md
- SfCalendar widget overview and features
- When to use Calendar vs Date Range Picker
- Nine calendar view types explained
- Calendar-specific capabilities
- Basic calendar configuration
📄 For Date Range Picker: references/datepicker-overview.md
- SfDateRangePicker widget overview and features
- When to use Date Range Picker vs Calendar
- Four picker view types explained
- Date picker-specific capabilities
- Multi-picker view (side by side)
View Types and Navigation
📄 Read: references/views.md
- Month view (both components)
- Year, decade, century views (Date Range Picker)
- Day, week, workweek views (Calendar)
- Schedule view (Calendar)
- Timeline views: day, week, workweek, month (Calendar)
- Month agenda view (Calendar)
- View switching and navigation
- Week number display
- First day of week configuration
📄 Read: references/date-navigations.md
- Forward and backward navigation
- Programmatic date navigation
- Initial display date configuration
- Navigation arrows
- View mode switching controls
- Min/max date restrictions
- Blackout dates (disabled dates)
Calendar-Specific Features
📄 Read: references/appointments.md
- Calendar appointments (events/scheduling)
- Appointment class and properties
- CalendarDataSource setup and mapping
- Custom appointment objects
- All-day appointments
- Recurring appointments and rules
- Appointment display modes
- Time zone support for appointments
- Appointment customization
Date Range Picker-Specific Features
📄 Read: references/selections.md
- Selection modes (single, multiple, range, multi-range, extendable)
- Single date selection
- Multiple date selection
- Range selection (start and end dates)
- Multi-range selection (multiple ranges)
- Programmatic selection
- Selection changed callbacks
- Initial selected date
- Selection decoration and styling
Customization and Styling
📄 Read: references/customization.md
- Visual appearance customization
- Cell styling and colors
- Header customization
- Today highlight color
- Cell border color and background
- Selection decoration
- Theme integration
- Special time regions (Calendar)
- Month cell appearance
📄 Read: references/builders.md
- Custom cell builders
- Month cell builder
- Year cell builder
- Appointment builder (Calendar)
- Time region builder (Calendar)
- Resource header builder (Calendar)
- Builder patterns and examples
Event Handling
📄 Read: references/callbacks.md
- onSelectionChanged (both components)
- onViewChanged (both components)
- onTap and onLongPress (Calendar)
- onSubmit and onCancel (Date Range Picker)
- Calendar-specific callbacks (appointment interactions)
- Callback argument types
- Event handling patterns
Localization and Accessibility
📄 Read: references/localization.md
- Internationalization support
- Locale configuration
- Date format customization
- Header and cell formats
- Globalization examples
- Right-to-left (RTL) support
📄 Read: references/accessibility.md
- Screen reader support
- Semantic labels
- Keyboard navigation
- WCAG compliance
- Focus indicators
- Accessible date selection
Advanced Features
📄 Read: references/advanced-features.md
- Time zones (Calendar)
- Resource view (Calendar)
- Drag and drop (Calendar)
- Appointment resizing (Calendar)
- Load more appointments (Calendar)
- Hijri calendar support (Date Range Picker)
- Date restrictions and constraints (Date Range Picker)
- Action buttons (Date Range Picker)
- Current time indicator (Calendar)
Quick Start Examples
Basic Calendar with Appointments
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
class MyCalendar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('My Calendar')),
body: SfCalendar(
view: CalendarView.month,
dataSource: MeetingDataSource(_getDataSource()),
monthViewSettings: MonthViewSettings(
appointmentDisplayMode: MonthAppointmentDisplayMode.appointment
),
),
);
}
List<Meeting> _getDataSource() {
final List<Meeting> meetings = <Meeting>[];
final DateTime today = DateTime.now();
final DateTime startTime = DateTime(today.year, today.month, today.day, 9, 0, 0);
final DateTime endTime = startTime.add(Duration(hours: 2));
meetings.add(Meeting(
'Conference',
startTime,
endTime,
Color(0xFF0F8644),
false
));
return meetings;
}
}
class MeetingDataSource extends CalendarDataSource {
MeetingDataSource(List<Meeting> source) {
appointments = source;
}
@override
DateTime getStartTime(int index) => appointments![index].from;
@override
DateTime getEndTime(int index) => appointments![index].to;
@override
String getSubject(int index) => appointments![index].eventName;
@override
Color getColor(int index) => appointments![index].background;
@override
bool isAllDay(int index) => appointments![index].isAllDay;
}
class Meeting {
Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);
String eventName;
DateTime from;
DateTime to;
Color background;
bool isAllDay;
}
Basic Date Range Picker
import 'package:flutter/material.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
class MyDatePicker extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Select Date Range')),
body: SfDateRangePicker(
view: DateRangePickerView.month,
selectionMode: DateRangePickerSelectionMode.range,
onSelectionChanged: _onSelectionChanged,
showActionButtons: true,
),
);
}
void _onSelectionChanged(DateRangePickerSelectionChangedArgs args) {
if (args.value is PickerDateRange) {
final DateTime startDate = args.value.startDate;
final DateTime? endDate = args.value.endDate;
print('Selected range: $startDate to $endDate');
}
}
}
Date Picker with Multiple Selection
SfDateRangePicker(
view: DateRangePickerView.month,
selectionMode: DateRangePickerSelectionMode.multiple,
initialSelectedDates: [
DateTime.now(),
DateTime.now().add(Duration(days: 2)),
DateTime.now().add(Duration(days: 5)),
],
onSelectionChanged: (DateRangePickerSelectionChangedArgs args) {
final List<DateTime> selectedDates = args.value;
print('Selected ${selectedDates.length} dates');
},
)
Common Patterns
Pattern 1: Calendar with Different Views
// Switch between day, week, month, and schedule views
CalendarView _calendarView = CalendarView.month;
SfCalendar(
view: _calendarView,
dataSource: MeetingDataSource(_appointments),
onViewChanged: (ViewChangedDetails details) {
// Handle view changes
},
)
// Toggle view with buttons
void _changeView(CalendarView view) {
setState(() {
_calendarView = view;
});
}
Pattern 2: Date Range Filter for Reports
// Common pattern for selecting date ranges in analytics/reports
PickerDateRange? _selectedRange;
SfDateRangePicker(
selectionMode: DateRangePickerSelectionMode.range,
onSelectionChanged: (DateRangePickerSelectionChangedArgs args) {
setState(() {
_selectedRange = args.value;
});
},
showActionButtons: true,
onSubmit: (Object? value) {
if (_selectedRange != null) {
_loadReportData(_selectedRange!.startDate, _selectedRange!.endDate);
}
Navigator.pop(context);
},
)
Pattern 3: Customized Cell Appearance
// Custom styling for both components
SfCalendar(
view: CalendarView.month,
todayHighlightColor: Colors.blue,
cellBorderColor: Colors.grey[300],
backgroundColor: Colors.white,
selectionDecoration: BoxDecoration(
color: Colors.transparent,
border: Border.all(color: Colors.blue, width: 2),
borderRadius: BorderRadius.circular(4),
),
)
SfDateRangePicker(
todayHighlightColor: Colors.green,
selectionColor: Colors.blue,
rangeSelectionColor: Colors.blue.withOpacity(0.3),
startRangeSelectionColor: Colors.blue,
endRangeSelectionColor: Colors.blue,
)
Pattern 4: Restricting Date Selection
// Disable past dates and weekends
SfDateRangePicker(
minDate: DateTime.now(),
maxDate: DateTime.now().add(Duration(days: 365)),
selectableDayPredicate: (DateTime date) {
// Disable weekends
return date.weekday != DateTime.saturday &&
date.weekday != DateTime.sunday;
},
)
Key Properties
SfCalendar Essential Properties
view - Calendar view type (day, week, month, schedule, timeline, etc.)
dataSource - CalendarDataSource with appointments
initialDisplayDate - Date to display initially
initialSelectedDate - Initially selected date/time
monthViewSettings - Configuration for month view
timeSlotViewSettings - Configuration for day/week views
scheduleViewSettings - Configuration for schedule view
todayHighlightColor - Color for today's date
selectionDecoration - Selection styling
onTap - Callback when cell is tapped
onLongPress - Callback for long press
onViewChanged - Callback when view changes
onSelectionChanged - Callback when selection changes
showNavigationArrow - Show forward/backward arrows
showCurrentTimeIndicator - Show current time line
allowViewNavigation - Allow switching between views
firstDayOfWeek - First day of week (1-7)
blackoutDates - Dates to disable
minDate / maxDate - Date range restrictions
SfDateRangePicker Essential Properties
view - Picker view type (month, year, decade, century)
selectionMode - Selection mode (single, multiple, range, multiRange, extendableRange)
initialSelectedDate - Initially selected date
initialSelectedDates - Initially selected dates (multiple mode)
initialSelectedRange - Initially selected range
initialSelectedRanges - Initially selected ranges (multi-range mode)
initialDisplayDate - Date to display initially
monthViewSettings - Configuration for month view
yearViewSettings - Configuration for year view
todayHighlightColor - Color for today's date
selectionColor - Selection color
rangeSelectionColor - Range selection color
startRangeSelectionColor - Start date color
endRangeSelectionColor - End date color
onSelectionChanged - Callback when selection changes
onViewChanged - Callback when view changes
onSubmit - Callback when confirm button pressed
onCancel - Callback when cancel button pressed
showActionButtons - Show confirm/cancel buttons
showTodayButton - Show today button
allowViewNavigation - Allow switching between views
enablePastDates - Enable past date selection
minDate / maxDate - Date range restrictions
selectableDayPredicate - Custom date validation
monthCellStyle - Month cell styling
yearCellStyle - Year cell styling
Common Use Cases
- Meeting Scheduler - Use SfCalendar with schedule view
- Event Manager - Use SfCalendar with month view, recurring events, and drag-drop
- Booking System - Use SfDateRangePicker with range selection and date restrictions
- Date Filter - Use SfDateRangePicker with range/multi-range selection for reports
- Task Manager - Use SfCalendar with schedule view and all-day appointments
- Vacation Planner - Use SfDateRangePicker with multiple selection and blackout dates
- Resource Scheduler - Use SfCalendar with resource view and timeline
- Simple Date Input - Use SfDateRangePicker with single selection mode
1---2name: syncfusion-flutter-calendar-datepicker3description: Implements Syncfusion Flutter Calendar (SfCalendar) and Date Range Picker (SfDateRangePicker) widgets for date and scheduling UIs in Flutter apps. Use when building appointment calendars, booking systems, date range selectors, or event scheduling interfaces. This skill covers calendar views, recurring events, date navigation, localization, callbacks, and customization.4---56# Syncfusion Flutter Calendar & Date Range Picker78This skill covers two related Syncfusion Flutter components for date and calendar functionality: **SfCalendar** (Event Calendar) and **SfDateRangePicker** (Date Range Picker). While they share many visual and configuration features, they serve different primary purposes.910## When to Use This Skill1112Use this skill when you need to:1314- **Implement event calendars** with appointments, scheduling, and time management15- **Add date selection** to forms, filters, or booking interfaces16- **Display calendar views** (month, week, day, year, decade, timeline, schedule)17- **Handle date range selection** for reports, analytics, or filtering18- **Create appointment/booking systems** with recurring events and time zones19- **Build scheduling interfaces** with drag-drop, resizing, and resource views20- **Enable date navigation** with various view modes and restrictions21- **Customize calendar appearance** with builders, themes, and styling22- **Support multiple date selection modes** (single, multiple, range, multi-range)23- **Integrate calendar localization** with RTL support and accessibility2425## Choosing the Right Component2627### Use **SfCalendar** (Event Calendar) when:28- You need to **display and manage appointments/events**29- Your app requires **scheduling functionality** (booking, meetings, tasks)30- You need **timeline views** or **schedule views** for event management31- **Time-based views** are important (day, week, workweek with time slots)32- You need **recurring events**, **time zones**, or **resource allocation**33- **Drag-and-drop** or **appointment resizing** is required34- Building calendars for: meeting schedulers, appointment books, task managers, event planners3536### Use **SfDateRangePicker** (Date Range Picker) when:37- You need **date selection** without appointment management38- Your primary goal is **picking dates or date ranges** for forms/filters39- You need **flexible selection modes** (single, multiple, range, multi-range)40- **Simplified date input** for booking start/end dates, report periods, etc.41- You want **action buttons** (confirm/cancel) for date selection dialogs42- Building UI for: date filters, booking dates, report date ranges, form date inputs4344### Key Differences Summary:4546| Feature | SfCalendar | SfDateRangePicker |47|---------|-----------|-------------------|48| **Primary Purpose** | Event scheduling & display | Date selection |49| **Appointments/Events** | ✅ Full support | ❌ Not supported |50| **View Types** | 9 views (day, week, timeline, etc.) | 4 views (month, year, decade, century) |51| **Selection Modes** | Single date/time slot | Single, multiple, range, multi-range |52| **Time Slots** | ✅ Yes (with time) | ❌ Dates only |53| **Action Buttons** | ❌ No | ✅ Confirm/Cancel buttons |54| **Recurring Events** | ✅ Yes | ❌ No |55| **Time Zones** | ✅ Yes | ❌ No |56| **Resource View** | ✅ Yes | ❌ No |57| **Drag & Drop** | ✅ Yes | ❌ No |5859## Documentation and Navigation Guide6061### Getting Started6263📄 **Read:** [references/getting-started.md](references/getting-started.md)64- Installation and package setup for both components65- Basic SfCalendar implementation66- Basic SfDateRangePicker implementation67- Package dependencies and imports68- Quick comparison and first examples6970### Component Overview7172📄 **For Calendar:** [references/calendar-overview.md](references/calendar-overview.md)73- SfCalendar widget overview and features74- When to use Calendar vs Date Range Picker75- Nine calendar view types explained76- Calendar-specific capabilities77- Basic calendar configuration7879📄 **For Date Range Picker:** [references/datepicker-overview.md](references/datepicker-overview.md)80- SfDateRangePicker widget overview and features81- When to use Date Range Picker vs Calendar82- Four picker view types explained83- Date picker-specific capabilities84- Multi-picker view (side by side)8586### View Types and Navigation8788📄 **Read:** [references/views.md](references/views.md)89- Month view (both components)90- Year, decade, century views (Date Range Picker)91- Day, week, workweek views (Calendar)92- Schedule view (Calendar)93- Timeline views: day, week, workweek, month (Calendar)94- Month agenda view (Calendar)95- View switching and navigation96- Week number display97- First day of week configuration9899📄 **Read:** [references/date-navigations.md](references/date-navigations.md)100- Forward and backward navigation101- Programmatic date navigation102- Initial display date configuration103- Navigation arrows104- View mode switching controls105- Min/max date restrictions106- Blackout dates (disabled dates)107108### Calendar-Specific Features109110📄 **Read:** [references/appointments.md](references/appointments.md)111- **Calendar appointments** (events/scheduling)112- Appointment class and properties113- CalendarDataSource setup and mapping114- Custom appointment objects115- All-day appointments116- Recurring appointments and rules117- Appointment display modes118- Time zone support for appointments119- Appointment customization120121### Date Range Picker-Specific Features122123📄 **Read:** [references/selections.md](references/selections.md)124- **Selection modes** (single, multiple, range, multi-range, extendable)125- Single date selection126- Multiple date selection127- Range selection (start and end dates)128- Multi-range selection (multiple ranges)129- Programmatic selection130- Selection changed callbacks131- Initial selected date132- Selection decoration and styling133134### Customization and Styling135136📄 **Read:** [references/customization.md](references/customization.md)137- Visual appearance customization138- Cell styling and colors139- Header customization140- Today highlight color141- Cell border color and background142- Selection decoration143- Theme integration144- Special time regions (Calendar)145- Month cell appearance146147📄 **Read:** [references/builders.md](references/builders.md)148- Custom cell builders149- Month cell builder150- Year cell builder151- Appointment builder (Calendar)152- Time region builder (Calendar)153- Resource header builder (Calendar)154- Builder patterns and examples155156### Event Handling157158📄 **Read:** [references/callbacks.md](references/callbacks.md)159- onSelectionChanged (both components)160- onViewChanged (both components)161- onTap and onLongPress (Calendar)162- onSubmit and onCancel (Date Range Picker)163- Calendar-specific callbacks (appointment interactions)164- Callback argument types165- Event handling patterns166167### Localization and Accessibility168169📄 **Read:** [references/localization.md](references/localization.md)170- Internationalization support171- Locale configuration172- Date format customization173- Header and cell formats174- Globalization examples175- Right-to-left (RTL) support176177📄 **Read:** [references/accessibility.md](references/accessibility.md)178- Screen reader support179- Semantic labels180- Keyboard navigation181- WCAG compliance182- Focus indicators183- Accessible date selection184185### Advanced Features186187📄 **Read:** [references/advanced-features.md](references/advanced-features.md)188- Time zones (Calendar)189- Resource view (Calendar)190- Drag and drop (Calendar)191- Appointment resizing (Calendar)192- Load more appointments (Calendar)193- Hijri calendar support (Date Range Picker)194- Date restrictions and constraints (Date Range Picker)195- Action buttons (Date Range Picker)196- Current time indicator (Calendar)197198## Quick Start Examples199200### Basic Calendar with Appointments201202```dart203import 'package:flutter/material.dart';204import 'package:syncfusion_flutter_calendar/calendar.dart';205206class MyCalendar extends StatelessWidget {207 @override208 Widget build(BuildContext context) {209 return Scaffold(210 appBar: AppBar(title: Text('My Calendar')),211 body: SfCalendar(212 view: CalendarView.month,213 dataSource: MeetingDataSource(_getDataSource()),214 monthViewSettings: MonthViewSettings(215 appointmentDisplayMode: MonthAppointmentDisplayMode.appointment216 ),217 ),218 );219 }220221 List<Meeting> _getDataSource() {222 final List<Meeting> meetings = <Meeting>[];223 final DateTime today = DateTime.now();224 final DateTime startTime = DateTime(today.year, today.month, today.day, 9, 0, 0);225 final DateTime endTime = startTime.add(Duration(hours: 2));226 227 meetings.add(Meeting(228 'Conference',229 startTime,230 endTime,231 Color(0xFF0F8644),232 false233 ));234 235 return meetings;236 }237}238239class MeetingDataSource extends CalendarDataSource {240 MeetingDataSource(List<Meeting> source) {241 appointments = source;242 }243244 @override245 DateTime getStartTime(int index) => appointments![index].from;246 247 @override248 DateTime getEndTime(int index) => appointments![index].to;249 250 @override251 String getSubject(int index) => appointments![index].eventName;252 253 @override254 Color getColor(int index) => appointments![index].background;255 256 @override257 bool isAllDay(int index) => appointments![index].isAllDay;258}259260class Meeting {261 Meeting(this.eventName, this.from, this.to, this.background, this.isAllDay);262 263 String eventName;264 DateTime from;265 DateTime to;266 Color background;267 bool isAllDay;268}269```270271### Basic Date Range Picker272273```dart274import 'package:flutter/material.dart';275import 'package:syncfusion_flutter_datepicker/datepicker.dart';276277class MyDatePicker extends StatelessWidget {278 @override279 Widget build(BuildContext context) {280 return Scaffold(281 appBar: AppBar(title: Text('Select Date Range')),282 body: SfDateRangePicker(283 view: DateRangePickerView.month,284 selectionMode: DateRangePickerSelectionMode.range,285 onSelectionChanged: _onSelectionChanged,286 showActionButtons: true,287 ),288 );289 }290291 void _onSelectionChanged(DateRangePickerSelectionChangedArgs args) {292 if (args.value is PickerDateRange) {293 final DateTime startDate = args.value.startDate;294 final DateTime? endDate = args.value.endDate;295 print('Selected range: $startDate to $endDate');296 }297 }298}299```300301### Date Picker with Multiple Selection302303```dart304SfDateRangePicker(305 view: DateRangePickerView.month,306 selectionMode: DateRangePickerSelectionMode.multiple,307 initialSelectedDates: [308 DateTime.now(),309 DateTime.now().add(Duration(days: 2)),310 DateTime.now().add(Duration(days: 5)),311 ],312 onSelectionChanged: (DateRangePickerSelectionChangedArgs args) {313 final List<DateTime> selectedDates = args.value;314 print('Selected ${selectedDates.length} dates');315 },316)317```318319## Common Patterns320321### Pattern 1: Calendar with Different Views322323```dart324// Switch between day, week, month, and schedule views325CalendarView _calendarView = CalendarView.month;326327SfCalendar(328 view: _calendarView,329 dataSource: MeetingDataSource(_appointments),330 onViewChanged: (ViewChangedDetails details) {331 // Handle view changes332 },333)334335// Toggle view with buttons336void _changeView(CalendarView view) {337 setState(() {338 _calendarView = view;339 });340}341```342343### Pattern 2: Date Range Filter for Reports344345```dart346// Common pattern for selecting date ranges in analytics/reports347PickerDateRange? _selectedRange;348349SfDateRangePicker(350 selectionMode: DateRangePickerSelectionMode.range,351 onSelectionChanged: (DateRangePickerSelectionChangedArgs args) {352 setState(() {353 _selectedRange = args.value;354 });355 },356 showActionButtons: true,357 onSubmit: (Object? value) {358 if (_selectedRange != null) {359 _loadReportData(_selectedRange!.startDate, _selectedRange!.endDate);360 }361 Navigator.pop(context);362 },363)364```365366### Pattern 3: Customized Cell Appearance367368```dart369// Custom styling for both components370SfCalendar(371 view: CalendarView.month,372 todayHighlightColor: Colors.blue,373 cellBorderColor: Colors.grey[300],374 backgroundColor: Colors.white,375 selectionDecoration: BoxDecoration(376 color: Colors.transparent,377 border: Border.all(color: Colors.blue, width: 2),378 borderRadius: BorderRadius.circular(4),379 ),380)381382SfDateRangePicker(383 todayHighlightColor: Colors.green,384 selectionColor: Colors.blue,385 rangeSelectionColor: Colors.blue.withOpacity(0.3),386 startRangeSelectionColor: Colors.blue,387 endRangeSelectionColor: Colors.blue,388)389```390391### Pattern 4: Restricting Date Selection392393```dart394// Disable past dates and weekends395SfDateRangePicker(396 minDate: DateTime.now(),397 maxDate: DateTime.now().add(Duration(days: 365)),398 selectableDayPredicate: (DateTime date) {399 // Disable weekends400 return date.weekday != DateTime.saturday && 401 date.weekday != DateTime.sunday;402 },403)404```405406## Key Properties407408### SfCalendar Essential Properties409410- `view` - Calendar view type (day, week, month, schedule, timeline, etc.)411- `dataSource` - CalendarDataSource with appointments412- `initialDisplayDate` - Date to display initially413- `initialSelectedDate` - Initially selected date/time414- `monthViewSettings` - Configuration for month view415- `timeSlotViewSettings` - Configuration for day/week views416- `scheduleViewSettings` - Configuration for schedule view417- `todayHighlightColor` - Color for today's date418- `selectionDecoration` - Selection styling419- `onTap` - Callback when cell is tapped420- `onLongPress` - Callback for long press421- `onViewChanged` - Callback when view changes422- `onSelectionChanged` - Callback when selection changes423- `showNavigationArrow` - Show forward/backward arrows424- `showCurrentTimeIndicator` - Show current time line425- `allowViewNavigation` - Allow switching between views426- `firstDayOfWeek` - First day of week (1-7)427- `blackoutDates` - Dates to disable428- `minDate` / `maxDate` - Date range restrictions429430### SfDateRangePicker Essential Properties431432- `view` - Picker view type (month, year, decade, century)433- `selectionMode` - Selection mode (single, multiple, range, multiRange, extendableRange)434- `initialSelectedDate` - Initially selected date435- `initialSelectedDates` - Initially selected dates (multiple mode)436- `initialSelectedRange` - Initially selected range437- `initialSelectedRanges` - Initially selected ranges (multi-range mode)438- `initialDisplayDate` - Date to display initially439- `monthViewSettings` - Configuration for month view440- `yearViewSettings` - Configuration for year view441- `todayHighlightColor` - Color for today's date442- `selectionColor` - Selection color443- `rangeSelectionColor` - Range selection color444- `startRangeSelectionColor` - Start date color445- `endRangeSelectionColor` - End date color446- `onSelectionChanged` - Callback when selection changes447- `onViewChanged` - Callback when view changes448- `onSubmit` - Callback when confirm button pressed449- `onCancel` - Callback when cancel button pressed450- `showActionButtons` - Show confirm/cancel buttons451- `showTodayButton` - Show today button452- `allowViewNavigation` - Allow switching between views453- `enablePastDates` - Enable past date selection454- `minDate` / `maxDate` - Date range restrictions455- `selectableDayPredicate` - Custom date validation456- `monthCellStyle` - Month cell styling457- `yearCellStyle` - Year cell styling458459## Common Use Cases4604611. **Meeting Scheduler** - Use SfCalendar with schedule view4622. **Event Manager** - Use SfCalendar with month view, recurring events, and drag-drop4633. **Booking System** - Use SfDateRangePicker with range selection and date restrictions4644. **Date Filter** - Use SfDateRangePicker with range/multi-range selection for reports4655. **Task Manager** - Use SfCalendar with schedule view and all-day appointments4666. **Vacation Planner** - Use SfDateRangePicker with multiple selection and blackout dates4677. **Resource Scheduler** - Use SfCalendar with resource view and timeline4688. **Simple Date Input** - Use SfDateRangePicker with single selection mode