refactor(screens): migrate playlist and library-folder headers to AlbumDetailHeader

Both carried yet another copy of the collapsing detail header.
AlbumDetailHeader gains appBarTitle (selection-aware toolbar title) and a
leading override for the folder screen's close/back switch. The playlist
header adopts the album layout (bottom-anchored content, 0.85 gradient,
length-adaptive title size, scrim only when blurred) instead of its
drifted centered variant; motion-banner and pill-chip meta are preserved
through the slots.
This commit is contained in:
zarzet
2026-07-11 17:18:01 +07:00
parent 05415d96d5
commit 59a5ca622d
3 changed files with 234 additions and 517 deletions
+22 -12
View File
@@ -20,6 +20,8 @@ class AlbumDetailHeader extends StatelessWidget {
this.meta,
this.actions,
this.appBarActions,
this.appBarTitle,
this.leading,
this.backgroundColor,
});
@@ -50,6 +52,13 @@ class AlbumDetailHeader extends StatelessWidget {
/// Extra toolbar actions (top-right).
final List<Widget>? appBarActions;
/// Toolbar title when it should differ from [title] (e.g. a selection
/// count); defaults to [title].
final String? appBarTitle;
/// Replaces the default circular back button.
final Widget? leading;
final Color? backgroundColor;
/// Shrinks long titles so up to three lines fit the header.
@@ -74,7 +83,7 @@ class AlbumDetailHeader extends StatelessWidget {
duration: const Duration(milliseconds: 200),
opacity: showTitleInAppBar ? 1.0 : 0.0,
child: Text(
title,
appBarTitle ?? title,
style: TextStyle(
color: colorScheme.onSurface,
fontWeight: FontWeight.w600,
@@ -198,18 +207,19 @@ class AlbumDetailHeader extends StatelessWidget {
);
},
),
leading: IconButton(
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
icon: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.4),
shape: BoxShape.circle,
leading: leading ??
IconButton(
tooltip: MaterialLocalizations.of(context).backButtonTooltip,
icon: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
color: Colors.black.withValues(alpha: 0.4),
shape: BoxShape.circle,
),
child: const Icon(Icons.arrow_back, color: Colors.white),
),
onPressed: () => Navigator.pop(context),
),
child: const Icon(Icons.arrow_back, color: Colors.white),
),
onPressed: () => Navigator.pop(context),
),
actions: appBarActions,
);
}