feat(player): Now Playing als Tab statt Push-Screen, Favoriten-Herz
- songToMediaItem trägt jetzt die Song-UUID in extras['songId'], damit Downstream-Code (Favoriten-Button, später Playback-History) den echten Song wiederfinden kann statt nur die file-URI zu haben - NowPlayingScreen: Schließen-Button entfernt (AppBar-leading), da der Screen jetzt als eigener Tab läuft statt gepusht zu werden - FavoriteButton für den aktuellen Song in die AppBar-Actions eingebaut, reaktiv über einen verschachtelten StreamBuilder<MediaItem?>; ohne gültige songId (z.B. nichts spielt) wird kein Button gerendert Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
62c65e8eca
commit
2712ace665
@@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../shared/cover.dart';
|
||||
import '../shared/favorite_button.dart';
|
||||
import '../shared/theme.dart';
|
||||
import 'audio_handler.dart';
|
||||
|
||||
@@ -16,12 +17,15 @@ class NowPlayingScreen extends StatelessWidget {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
backgroundColor: Colors.transparent,
|
||||
leading: IconButton(
|
||||
tooltip: 'Schließen',
|
||||
icon: const Icon(Icons.keyboard_arrow_down),
|
||||
onPressed: () => Navigator.of(context).maybePop(),
|
||||
),
|
||||
actions: [
|
||||
StreamBuilder<MediaItem?>(
|
||||
stream: handler.mediaItem,
|
||||
builder: (context, snapshot) {
|
||||
final songId = snapshot.data?.extras?['songId'] as String?;
|
||||
if (songId == null) return const SizedBox.shrink();
|
||||
return FavoriteButton(songId: songId);
|
||||
},
|
||||
),
|
||||
_SleepTimerButton(handler: handler),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user