initialDisplayDate property
The initial date to show on the SfDateRangePicker
The SfDateRangePicker will display the dates based on the date set in this property.
Defaults to current date.
Note: If the controller and it's controller.displayDate
property is
not null
then this property will be ignored and the widget render the
dates based on the date given in controller.displayDate
.
See also:
- DateRangePickerController.displayDate, which allows to move the date range picker to specific date.
- DateRangePickerController.forward, which allows to navigate to next view of the date range picker programmatically.
- DateRangePickerController.backward, which allows to navigate to previous view of the date range picker programmatically.
- onViewChanged, the callback which will notify that the current visible dates were changed in date range picker.
- initialSelectedDate, which allows to select date programmatically initially on date range picker.
- initialSelectedDates, which allows to list of select date programmatically initially on date range picker.
- initialSelectedRange, which allows to select a range of dates programmatically initially on date range picker.
- initialSelectedRanges, which allows to select a ranges of dates programmatically initially on date range picker.
- minDate, which is the least available date for the date range picker.
- maxDate, which is the last available date for the date range picker.
- showNavigationArrow, which display the navigation arrows on the header view of the date range picker.
- Knowledge base: How to navigate to the previous or next views using navigation arrows
- Knowledge base: How to do programmatic navigation
- Knowledge base: How to programmatically navigate to adjacent dates
- Knowledge base: How to programmatically navigate
- Knowledge base: How to restrict date range picker within date limit
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfDateRangePicker(
view: DateRangePickerView.month,
initialDisplayDate: DateTime(2025, 02, 05),
),
),
);
}
Implementation
final DateTime initialDisplayDate;