NowPlayingScreen: von Scaffold/Route zu Overlay-Inhalt in HomeShell umgebaut
This commit is contained in:
+29
-1
@@ -20,6 +20,7 @@ import 'library/search_screen.dart';
|
||||
import 'player/audio_effects.dart';
|
||||
import 'player/audio_handler.dart';
|
||||
import 'player/mini_player.dart';
|
||||
import 'player/now_playing_screen.dart';
|
||||
import 'player/player_expansion_controller.dart';
|
||||
import 'services/baka_auth.dart';
|
||||
import 'services/logger_service.dart';
|
||||
@@ -304,7 +305,26 @@ class _HomeShellState extends State<HomeShell>
|
||||
),
|
||||
child: const MiniPlayer(),
|
||||
),
|
||||
// NowPlayingScreen-Overlay-Inhalt folgt in Task 5 hier.
|
||||
AnimatedBuilder(
|
||||
animation: _expansion,
|
||||
builder: (context, child) {
|
||||
final p = _expansion.progress;
|
||||
return Positioned.fromRect(
|
||||
rect: Rect.lerp(_miniRect(context), _vollbildRect(context), p)!,
|
||||
child: Visibility(
|
||||
visible: p > 0,
|
||||
maintainState: true, // _CoverGrundState bleibt erhalten, siehe Spec
|
||||
maintainAnimation: true,
|
||||
child: Opacity(
|
||||
// Detail-Inhalt blendet erst ab p > 0.3 ein, siehe Spec.
|
||||
opacity: ((p - 0.3) / 0.7).clamp(0.0, 1.0),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const NowPlayingScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Haarlinie darüber: ohne sie geht die Leiste auf schwarzem Grund
|
||||
@@ -349,4 +369,12 @@ class _HomeShellState extends State<HomeShell>
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Rect _miniRect(BuildContext context) {
|
||||
final size = MediaQuery.sizeOf(context);
|
||||
final unten = size.height - MiniPlayer.hoehe - kBottomNavigationBarHeight;
|
||||
return Rect.fromLTWH(0, unten, size.width, MiniPlayer.hoehe);
|
||||
}
|
||||
|
||||
Rect _vollbildRect(BuildContext context) => Offset.zero & MediaQuery.sizeOf(context);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user