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