initialSelectedDate property

DateTime? initialSelectedDate
final

The date to initially select on the SfDateRangePicker.

The SfDateRangePicker will select the date that set to this property.

Defaults to null.

Note: If the controller and it's controller.selectedDate property is not null then this property will be ignored and the widget render the selection for the date given in controller.selectedDate.

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

See also:


Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: SfDateRangePicker(
         view: DateRangePickerView.month,
         initialSelectedDate: DateTime.now().add((Duration(days: 5))),
       ),
     ),
   );
 }

Implementation

final DateTime? initialSelectedDate;