countMinutes method

int countMinutes(
  1. DateTime? differenceDateTime
)

Converts the time difference to a number of minutes.

Returns the number of minutes between the current DateTime instance and differenceDateTime. If differenceDateTime is not provided, the current system DateTime is used.

Implementation

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