feat(flutter): wire TrackActionsButton into 4 surfaces
- TrackRow gains an actions: bool = true param; renders the button after duration. Album detail + Search + History/Liked tabs all consume TrackRow so they pick up the menu transitively. - CompactTrackCard (home Most-played) gets the button at the end of its inner row. - _PlaylistTrackRow in playlist_detail_screen gets the button next to duration; skipped for unavailable rows (no track id). - NowPlayingScreen renders the button next to the title with hideQueueActions: true (Play next / Add to queue suppressed since the menu's track IS the playing one). artistId is left empty since it's not stashed in MediaItem.extras — Go-to-artist will route to /artists/ which is benign for v1; a follow-up could stash it. Closes Tier 1 follow-up #2 (track-level actions menu). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import '../models/track.dart';
|
||||
import '../shared/widgets/track_actions/track_actions_button.dart';
|
||||
import '../theme/theme_extension.dart';
|
||||
import 'player_provider.dart';
|
||||
|
||||
@@ -46,7 +48,28 @@ class NowPlayingScreen extends ConsumerWidget {
|
||||
width: 280, height: 280, color: fs.slate,
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
Text(media.title, style: TextStyle(color: fs.parchment, fontSize: 22)),
|
||||
Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
Flexible(
|
||||
child: Text(
|
||||
media.title,
|
||||
style: TextStyle(color: fs.parchment, fontSize: 22),
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
TrackActionsButton(
|
||||
track: TrackRef(
|
||||
id: media.id,
|
||||
title: media.title,
|
||||
albumId: (media.extras?['album_id'] as String?) ?? '',
|
||||
albumTitle: media.album ?? '',
|
||||
artistId: '', // not stashed in MediaItem.extras today
|
||||
artistName: media.artist ?? '',
|
||||
durationSec: media.duration?.inSeconds ?? 0,
|
||||
streamUrl: '',
|
||||
),
|
||||
hideQueueActions: true,
|
||||
),
|
||||
]),
|
||||
Text(media.artist ?? '', style: TextStyle(color: fs.ash, fontSize: 14)),
|
||||
const SizedBox(height: 16),
|
||||
Slider(
|
||||
|
||||
Reference in New Issue
Block a user