forUnit method

Implementation

TimeAgoPluralLabels forUnit(TimeAgoUnit unit) {
  return switch (unit) {
    TimeAgoUnit.second => second,
    TimeAgoUnit.minute => minute,
    TimeAgoUnit.hour => hour,
    TimeAgoUnit.day => day,
    TimeAgoUnit.week => week,
    TimeAgoUnit.month => month,
    TimeAgoUnit.quarter => quarter,
    TimeAgoUnit.year => year,
    TimeAgoUnit.now => throw ArgumentError.value(
        unit,
        'unit',
        'The now unit cannot be part of multi-unit output.',
      ),
  };
}