subtitle method

  1. @override
String? subtitle(
  1. IRef contact
)
override

Implementation

@override
String? subtitle(IRef contact) {
  if (birthday!.isFullDate) {
    final birthdayThisYear = birthday!.toDateTime();
    final age = birthdayThisYear.yearsApart.abs();
    final verb = birthdayThisYear.isPast ? "Turned" : "Turns";
    if (age > 40) {
      return "$verb $age years young this year";
    } else {
      return "$verb $age this year";
    }
  }
  return null;
}