fix(desktop): cross-fade inspector panels on the style's effects spring

Switching between Lyrics and Up Next in the inspector cross-faded on a
fixed linear 180 ms in both styles. It now uses the effects spring of the
style; reduced motion still cuts.
This commit is contained in:
zarzet committed 2026-11-17 12:57:37 +07:00
1 parent dd0f1f1e87
commit 5b19204eab
1 file changed
+9 -3
+9 -3
View File
@@ -414,10 +414,16 @@ class _DesktopInspectorTransitionState extends State<DesktopInspectorTransition>
Widget build(BuildContext context) {
final shown = _shown;
if (shown == null) return const SizedBox.shrink();
// Switching panels cross-fades on the effects spring of the style.
final crossFade = AppMotion.effects(
context,
const AppMotionSpec(Duration.zero, Curves.linear),
mornye: MornyeMotion.effects,
);
final content = AnimatedSwitcher(
duration: MediaQuery.disableAnimationsOf(context)
? Duration.zero
: const Duration(milliseconds: 180),
duration: crossFade.duration,
switchInCurve: crossFade.curve,
switchOutCurve: crossFade.curve,
// Panels keep their fixed width while they cross-fade.
layoutBuilder: (current, previous) => Stack(
alignment: AlignmentDirectional.topStart,