toHumanizedString method
Formats this duration as 1:02:34 or 2:05.
Implementation
String toHumanizedString() {
final absolute = Duration(microseconds: inMicroseconds.abs());
final h = absolute.inHours;
final m = absolute.inMinutes % 60;
final s = absolute.inSeconds % 60;
final mm = '$m'.padLeft(2, '0');
final ss = '$s'.padLeft(2, '0');
final body = h > 0 ? '$h:$mm:$ss' : '$m:$ss';
return isNegative ? '-$body' : body;
}