selectedRanges property Null safety

List<HijriDateRange>? selectedRanges

List of selected ranges in the SfHijriDateRangePicker.

It is only applicable when the selectionMode set as DateRangePickerSelectionMode.multiRange for other selection modes this property will return as null.


List<HijriDateRange>? get selectedRanges => _selectedRanges;
void selectedRanges=(List<HijriDateRange>? ranges)

Selects the given date ranges programmatically in the SfHijriDateRangePicker by checking that the ranges of dates falls in between the minimum and maximum date range.

If it is not null the widget will render the date selection for the ranges set to this property, even the SfHijriDateRangePicker.initialSelectedRanges is not null.

Note: If any date ranges selected previously, will be removed and the selection will be drawn to the ranges of dates set to this property.

It is only applicable when the selectionMode set as DateRangePickerSelectionMode.multiRange.

See also:

class MyAppState extends State<MyApp> {
HijriDatePickerController _pickerController = HijriDatePickerController();

 void initState() {
   _pickerController.selectedRanges = <HijriDateRange>[
     HijriDateRange( 4)), 4))),
     HijriDateRange( 11)), 16)))

 Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: SfHijriDateRangePicker(
         controller: _pickerController,
         view: HijriDatePickerView.month,
         selectionMode: DateRangePickerSelectionMode.multiRange,


set selectedRanges(List<HijriDateRange>? ranges) {
  if (DateRangePickerHelper.isDateRangesEquals(_selectedRanges, ranges)) {

  _selectedRanges =