formatSeconds static method
Formats the given number of seconds into a 'mm:ss' string format.
Example: formatSeconds(125) returns '02:05'.
Implementation
static String formatSeconds(int seconds) {
final minutes = (seconds ~/ 60).toString().padLeft(2, '0');
final secs = (seconds % 60).toString().padLeft(2, '0');
return '$minutes:$secs';
}