durationFormatter method

  1. @override
String durationFormatter(
  1. Duration duration
)
override

Implementation

@override
String durationFormatter(Duration duration) {
  final int hours = duration.inHours;
  final String formatter = [
    if (hours != 0) hours,
    duration.inMinutes,
    duration.inSeconds
  ]
      .map((seg) => seg.abs().remainder(60).toString().padLeft(2, '0'))
      .join(':');
  return duration.inSeconds < 0 ? "-$formatter" : formatter;
}