feat(flutter): TrackRow renders TrackActionsButton by default

Adds optional actions: bool = true param. When true (default), renders
the 3-dot menu trigger at the end of the row. Album detail / Search /
History / Liked tabs all consume TrackRow so they pick up the menu
transitively.

Pair with c8baaa5 which wired the button into the other 3 surfaces;
this commit completes the wire-up by including TrackRow itself (its
write was missed in the previous commit).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-09 13:43:40 -04:00
parent c8baaa5329
commit 25ff7afc33
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import '../../models/track.dart';
import '../../shared/widgets/track_actions/track_actions_button.dart';
import '../../theme/theme_extension.dart';
class TrackRow extends StatelessWidget {
@@ -8,12 +9,18 @@ class TrackRow extends StatelessWidget {
required this.track,
required this.onTap,
this.trailing,
this.actions = true,
super.key,
});
final TrackRef track;
final VoidCallback onTap;
final Widget? trailing;
/// Render the 3-dot TrackActionsButton at the end of the row. Default
/// true; pass false in surfaces that don't want the menu (e.g. when
/// showing a static read-only list).
final bool actions;
@override
Widget build(BuildContext context) {
final fs = Theme.of(context).extension<FabledSwordTheme>()!;
@@ -54,6 +61,7 @@ class TrackRow extends StatelessWidget {
padding: const EdgeInsets.only(left: 8),
child: trailing!,
),
if (actions) TrackActionsButton(track: track),
]),
),
);