onTapDob method
- dynamic dobKey
Implementation
Future<void> onTapDob(dobKey) async {
DateTime? selectedDate = await showWebDatePicker(
context: dobKey.currentContext!,
initialDate: DateTime(1990),
firstDate: DateTime(1930),
lastDate: DateTime.now(),
withoutActionButtons: true,
);
if (selectedDate != null) {
String formattedDate = DateFormat('yyyy-MM-dd').format(selectedDate);
dobController.text = formattedDate;
}
}