fix(player): dissolve the sheet while it slides down on close

After the content fade, popping left an empty dark scaffold traveling
the full screen. The sheet now fades out over the second half of the
pop; opening and dragging keep it fully opaque.
This commit is contained in:
zarzet
2026-07-14 09:09:51 +07:00
parent 7a0be15359
commit 8610f18ff7
+7 -1
View File
@@ -96,11 +96,17 @@ class NowPlayingRoute extends PageRoute<void> {
curve: Easing.emphasizedDecelerate,
reverseCurve: Easing.emphasizedAccelerate,
);
// On pop the content has already faded out, so dissolve the sheet on its
// way down instead of sliding an empty dark surface across the screen.
// Forward (open) and drag keep the sheet fully opaque.
final opacity = animation.status == AnimationStatus.reverse
? CurvedAnimation(parent: animation, curve: const Interval(0.0, 0.5))
: const AlwaysStoppedAnimation(1.0);
return SlideTransition(
position: position.drive(
Tween(begin: const Offset(0, 1), end: Offset.zero),
),
child: child,
child: FadeTransition(opacity: opacity, child: child),
);
}
}