Last active
January 29, 2020 12:33
-
-
Save ShaiqAhmedkhan/0b6ea870192e8201bb147a8d843fa054 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class _ExplicitState extends State<Explicit> | |
with TickerProviderStateMixin { | |
AnimationController _repeatingAnimationShort; | |
AnimationController _repeatingAnimationLong; | |
AnimationController _loopingAnimationShort; | |
AnimationController _loopingAnimationLong; | |
Animatable<double> _scaleCurve; | |
Animatable<Offset> _slideCurve; | |
Animatable<Offset> _reverseSlide; | |
Animatable<double> _scaleCurveSlow; | |
@override | |
void initState() { | |
super.initState(); | |
_repeatingAnimationShort = AnimationController( | |
duration: const Duration(milliseconds: 3600), | |
vsync: this, | |
)..repeat(); | |
_repeatingAnimationLong = AnimationController( | |
duration: const Duration(seconds: 15), | |
vsync: this, | |
)..repeat(); | |
_loopingAnimationShort = AnimationController( | |
duration: const Duration(milliseconds: 3600), | |
vsync: this, | |
) | |
..addStatusListener((status) { | |
if (status == AnimationStatus.completed) { | |
_loopingAnimationShort.reverse(); | |
} else if (status == AnimationStatus.dismissed) { | |
_loopingAnimationShort.forward(); | |
} | |
}) | |
..forward(); | |
_loopingAnimationLong = AnimationController( | |
duration: const Duration(seconds: 30), | |
vsync: this, | |
) | |
..addStatusListener((status) { | |
if (status == AnimationStatus.completed) { | |
_loopingAnimationLong.reverse(); | |
} else if (status == AnimationStatus.dismissed) { | |
_loopingAnimationLong.forward(); | |
} | |
}) | |
..forward(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment