mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 17:00:39 +00:00
fixed timer stop state
This commit is contained in:
parent
faeca1adbd
commit
b008ef7c83
1 changed files with 2 additions and 1 deletions
|
@ -38,9 +38,10 @@ class TimerBloc extends Bloc<TimerEvent, TimerState> {
|
||||||
);
|
);
|
||||||
|
|
||||||
_timer = Timer.periodic(const Duration(seconds: 1), (_) {
|
_timer = Timer.periodic(const Duration(seconds: 1), (_) {
|
||||||
add(SetTimeLeftEvent(state.timeLeft - const Duration(seconds: 1)));
|
|
||||||
if (state.timeLeft.inMilliseconds == 0) {
|
if (state.timeLeft.inMilliseconds == 0) {
|
||||||
add(const StopTimerEvent());
|
add(const StopTimerEvent());
|
||||||
|
} else {
|
||||||
|
add(SetTimeLeftEvent(state.timeLeft - const Duration(seconds: 1)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue