displayDate property
HijriDateTime?
get
displayDate
The first date of the current visible view month, when the
HijriDatePickerMonthViewSettings.numberOfWeeksInView
set with
default value 6.
If the HijriDatePickerMonthViewSettings.numberOfWeeksInView
property set with value other then 6, this will return the first visible
date of the current month.
Implementation
HijriDateTime? get displayDate => _displayDate;
set
displayDate
(HijriDateTime? date)
Navigates to the given date programmatically without any animation in the SfHijriDateRangePicker by checking that the date falls in between the SfHijriDateRangePicker.minDate and SfHijriDateRangePicker.maxDate date range.
If the date falls beyond the SfHijriDateRangePicker.minDate and SfHijriDateRangePicker.maxDate the widget will move the widgets min or max date.
See also:
- SfHijriDateRangePicker.initialDisplayDate, which used to navigate the date range picker to the specific date initially.
- SfHijriDateRangePicker.onViewChanged, the callback which notifies when the current view visible date changed on the date range picker.
- Knowledge base: How to do programmatic navigation
- Knowledge base: How to programmatically navigate to adjacent dates
- Knowledge base: How to programmatically navigate
class MyAppState extends State<MyApp> {
HijriDatePickerController _pickerController = HijriDatePickerController();
@override
void initState() {
_pickerController.displayDate = HijriDateTime(2022, 02, 05);
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfHijriDateRangePicker(
controller: _pickerController,
view: HijriDatePickerView.month,
selectionMode: DateRangePickerSelectionMode.single,
),
),
);
}
}
Implementation
set displayDate(HijriDateTime? date) {
if (isSameDate(_displayDate, date)) {
return;
}
_displayDate = date;
notifyPropertyChangedListeners('displayDate');
}