🎵 Feature: Enhanced MiniPlayer (Phase 2, Part 8/X) — Now-Playing Widget
- Größeres MiniPlayer-Widget auf allen Non-Player-Screens (80px statt 60px) - Größeres Album-Cover (64px statt 44px) mit besserer Sichtbarkeit - Skip-Buttons (⏮️ Vorheriges + ⏭️ Nächstes) für schnelle Navigation - Progress-Bar zeigt Wiedergabe-Position in Echtzeit - Besseres Styling + Schrift-Gewicht für Titel - Funktioniert wie Home-Widget: zeigt überall was gerade spielt Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XJzQjUtnvYUtHdnTs3iCru
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
5563b79e6c
commit
c5b46e415a
@@ -26,23 +26,27 @@ class MiniPlayer extends StatelessWidget {
|
|||||||
onTap: () => Navigator.of(context).push(MaterialPageRoute(
|
onTap: () => Navigator.of(context).push(MaterialPageRoute(
|
||||||
builder: (_) => const NowPlayingScreen(),
|
builder: (_) => const NowPlayingScreen(),
|
||||||
)),
|
)),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
child: SizedBox(
|
child: SizedBox(
|
||||||
height: 60,
|
height: 80,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 12),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
child: CoverImage(artUri: item.artUri, size: 44, radius: 6),
|
child: CoverImage(artUri: item.artUri, size: 64, radius: 8),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 12),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(item.title,
|
Text(item.title,
|
||||||
maxLines: 1, overflow: TextOverflow.ellipsis),
|
maxLines: 1, overflow: TextOverflow.ellipsis,
|
||||||
|
style: const TextStyle(fontWeight: FontWeight.w600)),
|
||||||
Text(item.artist ?? 'Unbekannt',
|
Text(item.artist ?? 'Unbekannt',
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
overflow: TextOverflow.ellipsis,
|
overflow: TextOverflow.ellipsis,
|
||||||
@@ -55,17 +59,54 @@ class MiniPlayer extends StatelessWidget {
|
|||||||
stream: handler.playbackState,
|
stream: handler.playbackState,
|
||||||
builder: (context, snap) {
|
builder: (context, snap) {
|
||||||
final playing = snap.data?.playing ?? false;
|
final playing = snap.data?.playing ?? false;
|
||||||
return IconButton(
|
return Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.skip_previous),
|
||||||
|
onPressed: handler.skipToPrevious,
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
tooltip: playing ? 'Pause' : 'Abspielen',
|
tooltip: playing ? 'Pause' : 'Abspielen',
|
||||||
icon: Icon(playing ? Icons.pause : Icons.play_arrow),
|
icon: Icon(playing ? Icons.pause : Icons.play_arrow, size: 28),
|
||||||
onPressed: playing ? handler.pause : handler.play,
|
onPressed: playing ? handler.pause : handler.play,
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: const Icon(Icons.skip_next),
|
||||||
|
onPressed: handler.skipToNext,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
StreamBuilder<Duration?>(
|
||||||
|
stream: handler.durationStream,
|
||||||
|
builder: (context, dSnap) {
|
||||||
|
final duration = dSnap.data ?? Duration.zero;
|
||||||
|
return StreamBuilder<Duration>(
|
||||||
|
stream: handler.positionStream,
|
||||||
|
builder: (context, pSnap) {
|
||||||
|
final position = pSnap.data ?? Duration.zero;
|
||||||
|
return LinearProgressIndicator(
|
||||||
|
value: duration.inMilliseconds > 0
|
||||||
|
? (position.inMilliseconds / duration.inMilliseconds).clamp(0.0, 1.0)
|
||||||
|
: 0,
|
||||||
|
minHeight: 3,
|
||||||
|
backgroundColor: Colors.white12,
|
||||||
|
valueColor: const AlwaysStoppedAnimation(MeloTheme.red),
|
||||||
|
);
|
||||||
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user