toAge method

int? toAge()

Format DateTime to an age

Implementation

int? toAge() {
  if (this == null) return null;
  return DateTime.now().difference(this!).inDays ~/ 365;
}