monthViewSettings property
The settings have properties which allow to customize the month view of the SfDateRangePicker.
Allows to customize the DateRangePickerMonthViewSettings.numberOfWeeksInView, DateRangePickerMonthViewSettings.firstDayOfWeek, DateRangePickerMonthViewSettings.dayFormat, DateRangePickerMonthViewSettings.viewHeaderHeight, DateRangePickerMonthViewSettings.showTrailingAndLeadingDates, DateRangePickerMonthViewSettings.viewHeaderStyle, DateRangePickerMonthViewSettings.enableSwipeSelection, DateRangePickerMonthViewSettings.blackoutDates, DateRangePickerMonthViewSettings.specialDates and DateRangePickerMonthViewSettings.weekendDays in month view of date range picker.
See also:
- DateRangePickerMonthViewSettings, to know more about available options to customize the month view of date range picker
- monthCellStyle, which allows to customize the month cell of the month view of the date range picker
- cellBuilder, which allows to set custom widget for the picker cells in the date range picker.
- yearCellStyle, which allows to customize the year cell of the year, decade and century views of the date range picker.
- backgroundColor, which fills the background of the date range picker.
- todayHighlightColor, which highlights the today date cell in the date range picker.
- Knowledge base: How to customize leading and trailing dates using cell builder
- Knowledge base: How to customize the special dates using builder
- Knowledge base: How to update blackout dates using onViewChanged callback
- Knowledge base: How to select all days when clicking on the day header
- Knowledge base: How to change the first day of week
- Knowledge base: How to customize the date range picker cells using builder
- Knowledge base: How to change the week end dates
- Knowledge base: How to change the number of weeks
- Knowledge base: How to add active dates
- Knowledge base: How to apply theming
- Knowledge base: How to create timeline date picker
- Knowledge base: How to restrict swipe gesture for range selection
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfDateRangePicker(
view: DateRangePickerView.month,
monthViewSettings: DateRangePickerMonthViewSettings(
numberOfWeeksInView: 5,
firstDayOfWeek: 1,
dayFormat: 'E',
viewHeaderHeight: 70,
selectionRadius: 10,
showTrailingAndLeadingDates: true,
viewHeaderStyle: DateRangePickerViewHeaderStyle(
backgroundColor: Colors.blue,
textStyle:
TextStyle(fontWeight: FontWeight.w400,
fontSize: 15, color: Colors.black)),
enableSwipeSelection: false,
blackoutDates: <DateTime>[
DateTime.now().add(Duration(days: 4))
],
specialDates: <DateTime>[
DateTime.now().add(Duration(days: 7)),
DateTime.now().add(Duration(days: 8))
],
weekendDays: <int>[
DateTime.monday,
DateTime.friday
]),
),
),
);
}
Implementation
final DateRangePickerMonthViewSettings monthViewSettings;