numberOfWeeksInView property
The number of weeks to display in SfDateRangePicker's month view.
Defaults to 6.
Note: If this property is set to a value other than ' 6, ' the trailing
and lead dates style will not be updated and the trailing and leading
dates will be displayed even if the showTrailingAndLeadingDates property
is set to false.
This property not applicable when the SfDateRangePicker.pickerMode set
as DateRangePickerMode.hijri.
See also: DateRangePickerMonthCellStyle to know about leading and trailing dates style.
See also:
- showTrailingAndLeadingDates, which used to display the previous month and next month dates on the month view of the date range picker.
- firstDayOfWeek, which used to customize the week start day of the month view in date range picker.
- Knowledge base: How to change the number of weeks
- Knowledge base: How to create timeline date picker
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfDateRangePicker(
controller: _pickerController,
view: DateRangePickerView.month,
selectionMode: DateRangePickerSelectionMode.single,
monthViewSettings:
DateRangePickerMonthViewSettings(numberOfWeeksInView: 4),
),
),
);
}
Implementation
final int numberOfWeeksInView;