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:
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../../models/track.dart';
|
import '../../models/track.dart';
|
||||||
|
import '../../shared/widgets/track_actions/track_actions_button.dart';
|
||||||
import '../../theme/theme_extension.dart';
|
import '../../theme/theme_extension.dart';
|
||||||
|
|
||||||
class TrackRow extends StatelessWidget {
|
class TrackRow extends StatelessWidget {
|
||||||
@@ -8,12 +9,18 @@ class TrackRow extends StatelessWidget {
|
|||||||
required this.track,
|
required this.track,
|
||||||
required this.onTap,
|
required this.onTap,
|
||||||
this.trailing,
|
this.trailing,
|
||||||
|
this.actions = true,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
final TrackRef track;
|
final TrackRef track;
|
||||||
final VoidCallback onTap;
|
final VoidCallback onTap;
|
||||||
final Widget? trailing;
|
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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final fs = Theme.of(context).extension<FabledSwordTheme>()!;
|
final fs = Theme.of(context).extension<FabledSwordTheme>()!;
|
||||||
@@ -54,6 +61,7 @@ class TrackRow extends StatelessWidget {
|
|||||||
padding: const EdgeInsets.only(left: 8),
|
padding: const EdgeInsets.only(left: 8),
|
||||||
child: trailing!,
|
child: trailing!,
|
||||||
),
|
),
|
||||||
|
if (actions) TrackActionsButton(track: track),
|
||||||
]),
|
]),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user