constructTime function

String constructTime(
  1. int seconds
)

Implementation

String constructTime(int seconds) {
  int hour = seconds ~/ 3600;
  int minute = seconds % 3600 ~/ 60;
  int second = seconds % 60;
  if (seconds > 0 && seconds < 3600) {
    return "${formatTime(minute)}:${formatTime(second)}";
  } else if (seconds >= 3600 && seconds < 3600 * 60) {
    return "${formatTime(hour)}:${formatTime(minute)}:${formatTime(second)}";
  } else {
    return '00:00';
  }
}