forked from firka/flutter
Implement new AnimationStatus getters (#148570)
PR #147801 introduced some convenient `AnimationStatus` getters, but I just realized that `AnimationController` now has 2 getters for the same thing: `isAnimating` and `isRunning`. The intent of this pull request is to correct that mistake, and implement the getters in the appropriate places.
This commit is contained in:
@@ -318,10 +318,10 @@ class AnimatedBezierState extends State<AnimatedBezier>
|
||||
..addListener(() {
|
||||
setState(() {});
|
||||
})
|
||||
..addStatusListener((AnimationStatus state) {
|
||||
if (state == AnimationStatus.completed) {
|
||||
..addStatusListener((AnimationStatus status) {
|
||||
if (status.isCompleted) {
|
||||
reverseAnimation();
|
||||
} else if (state == AnimationStatus.dismissed) {
|
||||
} else if (status.isDismissed) {
|
||||
playAnimation();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -23,7 +23,7 @@ class ColumnOfTextState extends State<ColumnOfText> with SingleTickerProviderSta
|
||||
duration: const Duration(milliseconds: 300),
|
||||
)
|
||||
..addStatusListener((AnimationStatus status) {
|
||||
if (status == AnimationStatus.completed) {
|
||||
if (status.isCompleted) {
|
||||
setState(() {
|
||||
_showText = !_showText;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user