secondsToTimePassedShow method

String secondsToTimePassedShow()

Implementation

String secondsToTimePassedShow() {
  if (this == null) return '00:00';
  int seconds = this.toInt();
  int hour = seconds ~/ 3600;
  int minute = (seconds - hour * 3600) ~/ 60;
  int second = seconds - hour * 3600 - minute * 60;
  String hourStr = hour < 10 ? '0$hour' : '$hour';
  String minuteStr = minute < 10 ? '0$minute' : '$minute';
  String secondStr = second < 10 ? '0$second' : '$second';
  return '$minuteStr:$secondStr';
}