ML-54 AnimatedDialogState issues (#56)

* LateInitializationError: Field '_foregroundColorAnimation@1004358584'

* FlutterError: Null check operator used on a null value
This commit is contained in:
Vadim 2023-05-04 13:14:53 +02:00 committed by GitHub
parent 0583b07cb9
commit 2102213344
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -35,8 +35,8 @@ class AnimatedDialogState extends State<AnimatedDialog> with SingleTickerProvide
late final Animation<double> _borderRadiusAnimation;
late final Animation<double> _closedOpacityAnimation;
late final Animation<double> _openedOpacityAnimation;
late final Animation<Color?> _foregroundColorAnimation;
late final Animation<double> _elevationAnimation;
late Animation<Color?> _foregroundColorAnimation;
late Animation<double> _elevationAnimation;
bool _isDialogShown = false;
@ -185,16 +185,15 @@ class AnimatedDialogState extends State<AnimatedDialog> with SingleTickerProvide
_animateForward();
}
void _animateForward() {
Future<void> _animateForward() async {
setState(() {
_isDialogShown = true;
});
_animationController.forward();
await _animationController.forward();
}
Future<void> _animateReverse() async {
_animationController.reverse();
await Future.delayed(_animationController.reverseDuration! * timeDilation);
await _animationController.reverse();
setState(() {
_isDialogShown = false;
});