formatSecondToMinutes method

String formatSecondToMinutes({
  1. bool showSeconds = false,
})

Implementation

String formatSecondToMinutes({bool showSeconds = false}) {
  int min = this ~/ 60;
  int sec = (this % 60).toInt();

  if (min < 1) {
    return showSeconds ? '$sec sec' : '< 1 min';
  }

  return '$min min${showSeconds ? ' ${sec.abs()} sec' : ''}';
}