initialSelectedRanges property
The date ranges to initially select on the SfHijriDateRangePicker.
If it is not null
the SfHijriDateRangePicker will select the range of
dates that set to this property.
Defaults to null.
Note: If the controller and it's controller.selectedRanges
property
is not null
then this property will be ignored and the widget render the
selection for the ranges given in controller.selectedRanges
.
It is only applicable when the selectionMode set as DateRangePickerSelectionMode.multiRange.
See also:
- HijriDateRange, which is used to store the start and end date of the range selection.
- initialDisplayDate, which used to navigate the hijri date range picker to the specific date initially.
- initialSelectedDate, which allows to select date programmatically initially on hijri date range picker.
- initialSelectedDates, which allows to list of select date programmatically initially on hijri date range picker.
- initialSelectedRange, which allows to select a range of dates programmatically initially on hijri date range picker.
- HijriDatePickerController.selectedDate,which allows to select date programmatically dynamically on hijri date range picker.
- HijriDatePickerController.selectedDates, which allows to select dates programmatically dynamically on hijri date range picker.
- HijriDatePickerController.selectedRange, which allows to select range of dates programmatically dynamically on hijri date range picker.
- HijriDatePickerController.selectedRanges, which allows to select ranges of dates programmatically dynamically on hijri date range picker.
- selectionMode, which allows to customize the selection mode with available mode options.
- onSelectionChanged, the callback which notifies when the selection cell changed on the hijri date range picker.
- showActionButtons, which allows to cancel of confirm the selection in the hijri date range picker.
- onSubmit, the callback which notifies when the selected value confirmed through confirm button on hijri date range picker.
- onCancel, the callback which notifies when the selected value canceled and reverted to previous confirmed value through cancel button on hijri date range picker.
- Knowledge base: Range selection using multiple view picker
- Knowledge base: How to select a week
- Knowledge base: How to confirm or cancel the selection
- Knowledge base: How to select previous or next dates bases on selected date
- Knowledge base: How to change the selection radius
- Knowledge base: How to get the start and end date of the selected range
- Knowledge base: How to customize the selected range cells
- Knowledge base: How to restrict swipe gesture for range selection
- Knowledge base: How to programmatically select the date
- Knowledge base: How to change the selection shape
- Knowledge base: How to customize the selected month cell
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfHijriDateRangePicker(
view: HijriDatePickerView.month,
selectionMode: DateRangePickerSelectionMode.multiRange,
initialSelectedRanges: <HijriDateRange>[
HijriDateRange(
HijriDateTime.now().subtract(Duration(days: 4)),
HijriDateTime.now().add(Duration(days: 4))),
HijriDateRange(
HijriDateTime.now().add(Duration(days: 7)),
HijriDateTime.now().add(Duration(days: 14)))
],
),
),
);
}
Implementation
final List<HijriDateRange>? initialSelectedRanges;