initialSelectedRanges property

List<HijriDateRange>? initialSelectedRanges
final

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:


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;