timeUnitMessage method

String timeUnitMessage(
  1. String? timeUnit,
  2. bool single
)

Implementation

String timeUnitMessage(String? timeUnit, bool single) {
  if (single) {
    return timeUnit == 'd'
        ? 'day'
        : timeUnit == 'w'
            ? 'week'
            : timeUnit == 'm'
                ? 'month'
                : timeUnit == 'y'
                    ? 'year'
                    : '';
  } else {
    return timeUnit == 'd'
        ? 'days'
        : timeUnit == 'w'
            ? 'weeks'
            : timeUnit == 'm'
                ? 'months'
                : timeUnit == 'y'
                    ? 'years'
                    : '';
  }
}