onViewChanged property
Called when the current visible view or visible date range changes.
The visible date range and the visible view which visible on view when the view changes available in the HijriDatePickerViewChangedArgs.
See also:
- onSelectionChanged, callback which notifies whenever the selection changed on hijri date range picker.
- onSubmit, callback which notifies when the selection confirmed through the ok button of showActionButtons.
- onCancel, callback which notifies when the selection canceled through the cancel button of showActionButtons.
- HijriDatePickerViewChangedArgs, which contains the visible date range details of the current visible view.
- initialDisplayDate, which is used to navigate the hijri date range picker to specific date on initially.
- HijriDatePickerController.displayDate, which allows to move the hijri date range picker to specific date.
- HijriDatePickerController.forward, which allows to navigate to next view of the hijri date range picker programmatically.
- HijriDatePickerController.backward, which allows to navigate to previous view of the hijri date range picker programmatically.
- Knowledge base: How to update blackout dates using onViewChanged callback
- Knowledge base: How to customize the header in flutter multi date range picker
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SfHijriDateRangePicker(
view: HijriDatePickerView.month,
selectionMode: DateRangePickerSelectionMode.multiple,
showNavigationArrow: true,
onViewChanged: (HijriDatePickerViewChangedArgs args) {
final HijriDateRange _visibleDateRange =
args.visibleDateRange;
final HijriDatePickerView _visibleView = args.view;
},
),
),
);
}
Implementation
final HijriDatePickerViewChangedCallback? onViewChanged;