Dart
-
Time String Helper
Formatting Time in Flutter/Dart: A Simple Helper Class When working on Flutter projects, you might need to format durations into readable time strings. This could be for timers, media players, or activity trackers. To make this task a bit easier, here’s a lightweight helper class, TimeStringHelper, that handles common formatting needs. What TimeStringHelper Does Converts…
-
(Dart) Round integer to 10,100, 1000 etc.
If you need to shave off the last few digits of a big int, you can use this simple solution. Came in handy for me when working with milliseconds in timers. Basically you cast the integer to a double and divide it by the number of 0’s you want at the end. Then round, ceil…