calculateAgeFromNow method

int calculateAgeFromNow({
  1. DateTime? now,
})

Calculates the age based on the current date.

Args: now (DateTime?): The current date and time. Defaults to null (uses the actual current date and time).

Returns: int: The calculated age.

Implementation

int calculateAgeFromNow({DateTime? now}) {
  now ??= DateTime.now();

  return calculateAgeFromDate(now);
}