Created
January 25, 2022 03:52
-
-
Save sag333ar/e642dc9468a9707a839a1ab188881b9b to your computer and use it in GitHub Desktop.
Flutter - Seconds to Duration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 4515 seconds to | |
// (60 * 60 * 1) + (15 * 60) + (15) | |
// 01:15:15 | |
class Utilities { | |
static String formatTime(int seconds) { | |
return '${(Duration(seconds: seconds))}' | |
.split('.')[0] | |
.padLeft(8, '0'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment