format method

String format()

Formats the duration as H:MM:SS (e.g. 2:03:45).

Implementation

String format() {
  String two(int n) => n.toString().padLeft(2, '0');
  return '$inHours:${two(inMinutes % 60)}:${two(inSeconds % 60)}';
}