fmtDurLong function

String fmtDurLong(
  1. Duration d
)

Formats Duration as "mm:ss" when under an hour (same as fmtDur), or "hh:mm:ss" once it reaches an hour — for longer timers (energy/lives refill, boss events) where fmtDur would wrap and understate the time left. fmtDur itself is untouched (kept for its existing short-timer contract); use this one for anything that can run past 60 minutes.

Implementation

String fmtDurLong(Duration d) {
  if (d.inHours <= 0) return fmtDur(d);
  final h = d.inHours.toString().padLeft(2, '0');
  final m = d.inMinutes.remainder(60).toString().padLeft(2, '0');
  final s = d.inSeconds.remainder(60).toString().padLeft(2, '0');
  return '$h:$m:$s';
}