mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 10:47:25 +01:00
Reach initial values without animation
This commit is contained in:
parent
03fb8b2c49
commit
d18fd880ed
2 changed files with 6 additions and 2 deletions
|
|
@ -33,6 +33,7 @@ class _AppState extends State<App> with SingleTickerProviderStateMixin {
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
|
|
||||||
backend = Backend.of(context);
|
backend = Backend.of(context);
|
||||||
|
playerBarAnimation.value = backend.playerActive.value ? 1.0 : 0.0;
|
||||||
|
|
||||||
if (playerActiveSubscription != null) {
|
if (playerActiveSubscription != null) {
|
||||||
playerActiveSubscription.cancel();
|
playerActiveSubscription.cancel();
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,10 @@ class _PlayPauseButtonState extends State<PlayPauseButton>
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
|
||||||
playPauseAnimation =
|
playPauseAnimation = AnimationController(
|
||||||
AnimationController(vsync: this, duration: Duration(milliseconds: 300));
|
vsync: this,
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -28,6 +30,7 @@ class _PlayPauseButtonState extends State<PlayPauseButton>
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
|
|
||||||
backend = Backend.of(context);
|
backend = Backend.of(context);
|
||||||
|
playPauseAnimation.value = backend.playing.value ? 1.0 : 0.0;
|
||||||
|
|
||||||
if (playingSubscription != null) {
|
if (playingSubscription != null) {
|
||||||
playingSubscription.cancel();
|
playingSubscription.cancel();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue