getDuration method

String getDuration(
  1. Duration duration
)

Implementation

String getDuration(Duration duration) {
  String twoDigits(int n) => n.toString().padLeft(2, '0');

  final String twoDigitMinutes = twoDigits(duration.inMinutes.remainder(60));
  final String twoDigitSeconds = twoDigits(duration.inSeconds.remainder(60));
  return '$twoDigitMinutes:$twoDigitSeconds';
}