Skip to content

Commit

Permalink
ML-54 AnimatedDialogState issues (#56)
Browse files Browse the repository at this point in the history
* LateInitializationError: Field '_foregroundColorAnimation@1004358584'

* FlutterError: Null check operator used on a null value
  • Loading branch information
vodemn committed May 4, 2023
1 parent 0583b07 commit 2102213
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
});
Expand Down

0 comments on commit 2102213

Please sign in to comment.