Reach initial values without animation

This commit is contained in:
Elias Projahn 2019-12-03 12:33:43 +01:00
parent 03fb8b2c49
commit d18fd880ed
2 changed files with 6 additions and 2 deletions

View file

@ -33,6 +33,7 @@ class _AppState extends State<App> with SingleTickerProviderStateMixin {
super.didChangeDependencies();
backend = Backend.of(context);
playerBarAnimation.value = backend.playerActive.value ? 1.0 : 0.0;
if (playerActiveSubscription != null) {
playerActiveSubscription.cancel();

View file

@ -19,8 +19,10 @@ class _PlayPauseButtonState extends State<PlayPauseButton>
void initState() {
super.initState();
playPauseAnimation =
AnimationController(vsync: this, duration: Duration(milliseconds: 300));
playPauseAnimation = AnimationController(
vsync: this,
duration: Duration(milliseconds: 300),
);
}
@override
@ -28,6 +30,7 @@ class _PlayPauseButtonState extends State<PlayPauseButton>
super.didChangeDependencies();
backend = Backend.of(context);
playPauseAnimation.value = backend.playing.value ? 1.0 : 0.0;
if (playingSubscription != null) {
playingSubscription.cancel();