displayDate property Null safety

DateTime? displayDate

The first date of the current visible view month, when the MonthViewSettings.numberOfWeeksInView set with default value 6.

If the MonthViewSettings.numberOfWeeksInView property set with value other then 6, this will return the first visible date of the current month.


DateTime? get displayDate => _displayDate;
void displayDate=(DateTime? date)

Navigates to the given date programmatically without any animation in the SfDateRangePicker by checking that the date falls in between the SfDateRangePicker.minDate and SfDateRangePicker.maxDate date range.

If the date falls beyond the SfDateRangePicker.minDate and SfDateRangePicker.maxDate the widget will move the widgets min or max date.

See also:

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

 void initState() {
   _pickerController.displayDate = DateTime(2022, 02, 05);

 Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: SfDateRangePicker(
         controller: _pickerController,
         view: DateRangePickerView.month,
         selectionMode: DateRangePickerSelectionMode.single,


set displayDate(DateTime? date) {
  if (isSameDate(_displayDate, date)) {

  _displayDate = date;