feat(flutter/player): mini PlayerBar in shell + tap-to-play wiring
PlayerBar reads playbackState + mediaItem streams; hidden when no queue. Home track-row tap, album play button, album track tap, artist play button (shuffle) all route to playerActions.playTracks. Token + baseUrl forwarded to the audio handler before each new queue.
This commit is contained in:
@@ -5,6 +5,7 @@ import 'package:go_router/go_router.dart';
|
||||
import '../api/endpoints/likes.dart';
|
||||
import '../likes/like_button.dart';
|
||||
import '../models/album.dart';
|
||||
import '../player/player_provider.dart';
|
||||
import '../theme/theme_extension.dart';
|
||||
import 'library_providers.dart';
|
||||
import 'widgets/album_card.dart';
|
||||
@@ -49,7 +50,12 @@ class ArtistDetailScreen extends ConsumerWidget {
|
||||
decoration: BoxDecoration(color: fs.accent, shape: BoxShape.circle),
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.play_arrow, color: fs.parchment),
|
||||
onPressed: () { /* play wired in Task 18 */ },
|
||||
onPressed: () async {
|
||||
final tracks = await ref.read(artistTracksProvider(id).future);
|
||||
if (tracks.isEmpty) return;
|
||||
final shuffled = [...tracks]..shuffle();
|
||||
ref.read(playerActionsProvider).playTracks(shuffled);
|
||||
},
|
||||
),
|
||||
),
|
||||
LikeButton(kind: LikeKind.artist, id: a.id, size: 28),
|
||||
|
||||
Reference in New Issue
Block a user