mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
fixed hours parsing
This commit is contained in:
parent
90a4b9a056
commit
c8617ec00b
1 changed files with 1 additions and 2 deletions
|
@ -19,7 +19,6 @@ class TimerText extends StatelessWidget {
|
||||||
parseSeconds(),
|
parseSeconds(),
|
||||||
style: Theme.of(context).textTheme.displayMedium,
|
style: Theme.of(context).textTheme.displayMedium,
|
||||||
),
|
),
|
||||||
if (duration.inMinutes < 1)
|
|
||||||
Text(
|
Text(
|
||||||
addZeroIfNeeded(timeLeft.inMilliseconds % 1000, 3),
|
addZeroIfNeeded(timeLeft.inMilliseconds % 1000, 3),
|
||||||
style: Theme.of(context).textTheme.displaySmall,
|
style: Theme.of(context).textTheme.displaySmall,
|
||||||
|
@ -32,7 +31,7 @@ class TimerText extends StatelessWidget {
|
||||||
final buffer = StringBuffer();
|
final buffer = StringBuffer();
|
||||||
int remainingMs = timeLeft.inMilliseconds;
|
int remainingMs = timeLeft.inMilliseconds;
|
||||||
// longer than 1 hours
|
// longer than 1 hours
|
||||||
if (duration.inSeconds >= Duration.millisecondsPerHour) {
|
if (duration.inMilliseconds >= Duration.millisecondsPerHour) {
|
||||||
final hours = remainingMs ~/ Duration.millisecondsPerHour;
|
final hours = remainingMs ~/ Duration.millisecondsPerHour;
|
||||||
buffer.writeAll([addZeroIfNeeded(hours), ':']);
|
buffer.writeAll([addZeroIfNeeded(hours), ':']);
|
||||||
remainingMs -= hours * Duration.millisecondsPerHour;
|
remainingMs -= hours * Duration.millisecondsPerHour;
|
||||||
|
|
Loading…
Reference in a new issue