diff --git a/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart b/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart index d2eac90..4a506cc 100644 --- a/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart +++ b/lib/screens/metering/components/shared/readings_container/components/animated_dialog_picker/components/animated_dialog/widget_dialog_animated.dart @@ -35,8 +35,8 @@ class AnimatedDialogState extends State with SingleTickerProvide late final Animation _borderRadiusAnimation; late final Animation _closedOpacityAnimation; late final Animation _openedOpacityAnimation; - late final Animation _foregroundColorAnimation; - late final Animation _elevationAnimation; + late Animation _foregroundColorAnimation; + late Animation _elevationAnimation; bool _isDialogShown = false; @@ -185,16 +185,15 @@ class AnimatedDialogState extends State with SingleTickerProvide _animateForward(); } - void _animateForward() { + Future _animateForward() async { setState(() { _isDialogShown = true; }); - _animationController.forward(); + await _animationController.forward(); } Future _animateReverse() async { - _animationController.reverse(); - await Future.delayed(_animationController.reverseDuration! * timeDilation); + await _animationController.reverse(); setState(() { _isDialogShown = false; });