Polished Holidays view

This commit is contained in:
2023-06-12 21:16:59 +02:00
parent 7a791ef21f
commit 12bde4ab43
11 changed files with 206 additions and 96 deletions

View File

@ -13,11 +13,13 @@ class AnimatedTime extends StatefulWidget {
class _AnimatedTimeState extends State<AnimatedTime> {
Duration current = Duration.zero;
late Timer timer;
@override
void initState() {
super.initState();
Timer.periodic(const Duration(seconds: 1), (Timer t) => update());
timer = Timer.periodic(const Duration(seconds: 1), (Timer t) => update());
current = widget.callback();
}
void update() {
@ -50,4 +52,10 @@ class _AnimatedTimeState extends State<AnimatedTime> {
textStyle: const TextStyle(fontSize: 15),
);
}
@override
void dispose() {
timer.cancel();
super.dispose();
}
}