countMinutes function

String countMinutes(
  1. int difference
)

Converts the time difference to a number of minutes. This function truncates to the lowest minute. returns ("1 minute" OR "X minutes")

Implementation

String countMinutes(int difference) {
  int count = (difference / 60000).truncate();
  return count.toString() + (count > 1 ? ' minutes' : ' minute');
}