Skip to content

Instantly share code, notes, and snippets.

@lil5
Created September 23, 2021 15:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lil5/c0999049084f4d20064b3b92f22659a6 to your computer and use it in GitHub Desktop.
Save lil5/c0999049084f4d20064b3b92f22659a6 to your computer and use it in GitHub Desktop.
Dart MM:SS format
class Utils {
static String timeMinutesSeconds(int totalSeconds) {
int minutes = (totalSeconds / 60).truncate();
int seconds = minutes % 60;
return "$minutes:${seconds.toString().padLeft(2, '0')}";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment