selectedRange property Null safety

HijriDateRange? selectedRange

selected date range in the SfHijriDateRangePicker.

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


HijriDateRange? get selectedRange => _selectedRange;
void selectedRange=(HijriDateRange? range)

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

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

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

It is only applicable when the selectionMode set as HijriDateRangePickerSelectionMode.range.

See also:

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

 void initState() {
   _pickerController.selectedRange = HijriDateRange( 4)), 5)));

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


set selectedRange(HijriDateRange? range) {
  if (DateRangePickerHelper.isRangeEquals(_selectedRange, range)) {

  _selectedRange = range;