DateRangePickerMonthViewSettings class
The settings have properties which allow to customize the month view of the SfDateRangePicker.
Allows to customize the numberOfWeeksInView, firstDayOfWeek, dayFormat, viewHeaderHeight, showTrailingAndLeadingDates, viewHeaderStyle, enableSwipeSelection, blackoutDates, specialDates and weekendDays in month view of date range picker.
See also:
- HijriDatePickerMonthViewSettings, which used to customize the month view of the hijri date range picker.
- DateRangePickerMonthCellStyle, which used to customize the month cell of the month view in the date range picker.
- HijriDatePickerMonthCellStyle, which used to customize the month cell of the month view in the hijri date range picker.
- SfDateRangePicker.cellBuilder,which allows to set custom widget for the picker cells in the date range picker.
- DateRangePickerYearCellStyle, which allows to customize the year cell of the year, decade and century views of the date range picker.
- SfDateRangePicker.backgroundColor, which fills the background of the date range picker.
- SfDateRangePicker.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
]),
),
),
);
}
- Mixed-in types
- Annotations
Constructors
-
DateRangePickerMonthViewSettings({int numberOfWeeksInView = 6, int firstDayOfWeek = 7, String dayFormat = 'EE', double viewHeaderHeight = 30, @Deprecated('Use selectionRadius property in SfDateRangePicker') double selectionRadius = -1, bool showTrailingAndLeadingDates = false, DateRangePickerViewHeaderStyle viewHeaderStyle = const DateRangePickerViewHeaderStyle(), bool enableSwipeSelection = true, List<
DateTime> ? blackoutDates, List<DateTime> ? specialDates, List<int> weekendDays = const <int>[6, 7], bool showWeekNumber = false, DateRangePickerWeekNumberStyle weekNumberStyle = const DateRangePickerWeekNumberStyle()}) -
Creates a date range picker month view settings for date range picker.
const
Properties
-
blackoutDates
→ List<
DateTime> ? -
Disables the interactions for certain dates in the month view of
SfDateRangePicker.
final
- dayFormat → String
-
Formats a text in the SfDateRangePicker month view view header.
final
- enableSwipeSelection → bool
-
Enables the swipe selection for SfDateRangePicker, which allows to
select the range of dates by swiping on the dates.
final
- firstDayOfWeek → int
-
The first day of the week in the SfDateRangePicker month view.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- numberOfWeeksInView → int
-
The number of weeks to display in SfDateRangePicker's month view.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionRadius → double
-
The radius for the SfDateRangePicker selection circle in month view.
final
- showTrailingAndLeadingDates → bool
-
Makes the SfDateRangePicker month view leading and trailing dates
visible.
final
- showWeekNumber → bool
-
Used to displays the week number of the year in the month view of
the SfDateRangePicker.
final
-
specialDates
→ List<
DateTime> ? -
In the month view of SfDateRangePicker highlights the unique dates with
different style rather than the other dates style.
final
- viewHeaderHeight → double
-
The height of the view header to the layout within this in month view of
SfDateRangePicker.
final
- viewHeaderStyle → DateRangePickerViewHeaderStyle
-
Sets the style to customize SfDateRangePicker month view view header.
final
-
weekendDays
→ List<
int> -
The weekends for month view in SfDateRangePicker.
final
- weekNumberStyle → DateRangePickerWeekNumberStyle
-
Defines the text style for the text in the week number panel of the
SfDateRangePicker.
final
Methods
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override