mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-24 16:30:40 +00:00
ML-54 AnimatedDialogState
issues (#56)
* LateInitializationError: Field '_foregroundColorAnimation@1004358584' * FlutterError: Null check operator used on a null value
This commit is contained in:
parent
0583b07cb9
commit
2102213344
1 changed files with 5 additions and 6 deletions
|
@ -35,8 +35,8 @@ class AnimatedDialogState extends State<AnimatedDialog> with SingleTickerProvide
|
||||||
late final Animation<double> _borderRadiusAnimation;
|
late final Animation<double> _borderRadiusAnimation;
|
||||||
late final Animation<double> _closedOpacityAnimation;
|
late final Animation<double> _closedOpacityAnimation;
|
||||||
late final Animation<double> _openedOpacityAnimation;
|
late final Animation<double> _openedOpacityAnimation;
|
||||||
late final Animation<Color?> _foregroundColorAnimation;
|
late Animation<Color?> _foregroundColorAnimation;
|
||||||
late final Animation<double> _elevationAnimation;
|
late Animation<double> _elevationAnimation;
|
||||||
|
|
||||||
bool _isDialogShown = false;
|
bool _isDialogShown = false;
|
||||||
|
|
||||||
|
@ -185,16 +185,15 @@ class AnimatedDialogState extends State<AnimatedDialog> with SingleTickerProvide
|
||||||
_animateForward();
|
_animateForward();
|
||||||
}
|
}
|
||||||
|
|
||||||
void _animateForward() {
|
Future<void> _animateForward() async {
|
||||||
setState(() {
|
setState(() {
|
||||||
_isDialogShown = true;
|
_isDialogShown = true;
|
||||||
});
|
});
|
||||||
_animationController.forward();
|
await _animationController.forward();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _animateReverse() async {
|
Future<void> _animateReverse() async {
|
||||||
_animationController.reverse();
|
await _animationController.reverse();
|
||||||
await Future.delayed(_animationController.reverseDuration! * timeDilation);
|
|
||||||
setState(() {
|
setState(() {
|
||||||
_isDialogShown = false;
|
_isDialogShown = false;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue