onTapDOB method
Implementation
Future<void> onTapDOB(dobkey, [BuildContext? context]) async {
DateTime? selectedDate = (await showWebDatePicker(
context: context ?? dobkey.currentContext!,
initialDate: DateTime(1990),
firstDate: DateTime(1930),
lastDate: DateTime.now(),
selectedDayColor: ColorHelper.primaryColor1,
confirmButtonColor: ColorHelper.primaryColor1,
cancelButtonColor: ColorHelper.primaryColor1,
withoutActionButtons: true))
?.start;
if (selectedDate != null) {
String formattedDate = DateFormat('yyyy-MM-dd').format(selectedDate);
dobController.text = formattedDate;
}
}