formatSecondsTime static method

String formatSecondsTime(
  1. int seconds
)

Implementation

static String formatSecondsTime(int seconds) {
  if (seconds > 0) {
    int h = (seconds / 3600).floor();
    seconds = seconds - (h * 3600);
    int m = (seconds / 60).floor();
    int s = (seconds % 60).round();
    String hStr = _trimToRightPlaces("$h", 2);
    String mStr = _trimToRightPlaces("$m", 2);
    String sStr = _trimToRightPlaces("$s", 2);
    return "$hStr:$mStr:$sStr";
  } else {
    return "00:00";
  }
}