mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 17:00:39 +00:00
automatically close timer screen after timeout
This commit is contained in:
parent
057c43cc62
commit
fbd78986df
1 changed files with 3 additions and 1 deletions
|
@ -44,7 +44,9 @@ class TimerScreenState extends State<TimerScreen> with TickerProviderStateMixin
|
||||||
timelineController = AnimationController(vsync: this, duration: widget.duration);
|
timelineController = AnimationController(vsync: this, duration: widget.duration);
|
||||||
timelineAnimation = Tween<double>(begin: 1, end: 0).animate(timelineController);
|
timelineAnimation = Tween<double>(begin: 1, end: 0).animate(timelineController);
|
||||||
timelineController.addStatusListener((status) {
|
timelineController.addStatusListener((status) {
|
||||||
if (status == AnimationStatus.completed) {
|
if (timelineController.value == 1) {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
} else if (status == AnimationStatus.completed) {
|
||||||
context.read<TimerBloc>().add(const TimerEndedEvent());
|
context.read<TimerBloc>().add(const TimerEndedEvent());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue