chooseDate method
dynamic
chooseDate()
Implementation
chooseDate() async {
DateTime? pickedDate = await showDatePicker(
context: Get.context!,
initialDate: selectedDate.value,
firstDate: DateTime(2000),
lastDate: DateTime(2025),
//initialEntryMode: DatePickerEntryMode.input,
// initialDatePickerMode: DatePickerMode.year,
helpText: 'Select DOB',
cancelText: 'Close',
confirmText: 'Confirm',
errorFormatText: 'Enter valid date',
errorInvalidText: 'Enter valid date range',
fieldLabelText: 'DOB',
fieldHintText: 'Month/Date/Year',
selectableDayPredicate: disableDate);
if (pickedDate != null && pickedDate != selectedDate.value) {
selectedDate.value = pickedDate;
}
}