onInit method
Called immediately after the widget is allocated in memory. You might use this to initialize something for the controller.
Implementation
@override
void onInit() {
final clampedInitialDate = PickerPlusDateUtilsX.clampDateToRange(
max: maxDate,
min: minDate,
date: DateTime.now(),
);
displayedYear.value = PickerPlusDateUtilsX.yearOnly(initialDate ?? clampedInitialDate);
selectedMonth.value = selectedDate != null ? PickerPlusDateUtilsX.monthOnly(selectedDate!) : null;
pageController = PageController(
initialPage: (displayedYear.value!.year - minDate.year),
);
super.onInit();
}