selectedDates property Null safety

List<HijriDateTime>? selectedDates

The list of dates selected in the SfHijriDateRangePicker.

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


List<HijriDateTime>? get selectedDates => _selectedDates;
void selectedDates=(List<HijriDateTime>? dates)

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

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

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

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

See also:

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

 void initState() {
   _pickerController.selectedDates = <HijriDateTime>[ 4))), 7))), 8)))

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


set selectedDates(List<HijriDateTime>? dates) {
  if (DateRangePickerHelper.isDateCollectionEquals(_selectedDates, dates)) {

  _selectedDates =