calculateAge static method
Implementation
static int calculateAge({required DateTime birthDate}) {
DateTime today = DateTime.now();
int age = today.year - birthDate.year;
if (today.month < birthDate.month ||
(today.month == birthDate.month && today.day < birthDate.day)) {
age--;
}
return age;
}