initialSelectedRanges property Null safety

List<PickerDateRange>? initialSelectedRanges

The date ranges to initially select on the SfDateRangePicker.

If it is not null the SfDateRangePicker 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: SfDateRangePicker(
         view: DateRangePickerView.month,
         selectionMode: DateRangePickerSelectionMode.multiRange,
         initialSelectedRanges: <PickerDateRange>[
           PickerDateRange( 4)),
           PickerDateRange( 7)),


final List<PickerDateRange>? initialSelectedRanges;