refactor(screens): share album-screen scaffolding and track flows

- SelectionModeMixin + CollapsingHeaderScrollMixin extracted;
  local/downloaded album screens now share AlbumTrackTile,
  AlbumScaffoldBody, DestructiveSelectionButton, HeaderMetaRow,
  and confirmAndDeleteTracks
- track_detail_actions.dart: shared downloadSingleTrack,
  queueTracksSkippingDownloaded, download-all confirm, queued
  snackbar, release-date formatter, list footer, love-all
- TtlCache<T> replaces the copied 10-minute static caches;
  album fetch branches share _applyAlbumMetadata
- playlist error card now uses ErrorCard; formatMegabytes shared
  by queue tab and update dialog
This commit is contained in:
zarzet
2026-07-12 19:19:22 +07:00
parent 4b9853eef7
commit 44de61a06a
19 changed files with 1152 additions and 1478 deletions
+5
View File
@@ -55,6 +55,11 @@ String? normalizeRemoteHttpUrl(String? value) {
return null;
}
/// Byte count expressed as a plain megabyte number with 1 decimal, e.g. "3.4".
String formatMegabytes(num bytes) {
return (bytes / (1024 * 1024)).toStringAsFixed(1);
}
/// Human-readable byte size: "512 B", "3.4 KB", "12.0 MB", "1.25 GB".
String formatBytes(int bytes) {
if (bytes < 1024) return '$bytes B';