style(ui): 列表行距收紧 + 收藏项显示封面
- 收藏列表:vertical padding 6 -> 2,ListTile 用 compact, 标题 17->16、副标题 14->13,行高明显变紧凑 - 收藏项 leading 从音符图标换成 SongArtwork(复用 songs.artwork_path) - WebDAV 文件列表:contentPadding 去掉 vertical 2,加 compact 真机截图确认:行距更接近设计稿,有元数据的歌显示封面。
This commit is contained in:
@@ -6,6 +6,7 @@ import '../widgets/magnetic_scroll_physics.dart';
|
|||||||
import 'webdav_setup_page.dart';
|
import 'webdav_setup_page.dart';
|
||||||
import 'settings_page.dart';
|
import 'settings_page.dart';
|
||||||
import '../database/song_database.dart';
|
import '../database/song_database.dart';
|
||||||
|
import '../widgets/song_artwork.dart';
|
||||||
import 'webdav_file_list_page.dart';
|
import 'webdav_file_list_page.dart';
|
||||||
import '../constants/ui_constants.dart';
|
import '../constants/ui_constants.dart';
|
||||||
import '../base/base_state.dart';
|
import '../base/base_state.dart';
|
||||||
@@ -18,6 +19,7 @@ class SongItem {
|
|||||||
final String fileName;
|
final String fileName;
|
||||||
final String? title;
|
final String? title;
|
||||||
final String? artist;
|
final String? artist;
|
||||||
|
final String? artworkPath;
|
||||||
final String sourceTag;
|
final String sourceTag;
|
||||||
final String metadataState;
|
final String metadataState;
|
||||||
|
|
||||||
@@ -26,6 +28,7 @@ class SongItem {
|
|||||||
required this.fileName,
|
required this.fileName,
|
||||||
this.title,
|
this.title,
|
||||||
this.artist,
|
this.artist,
|
||||||
|
this.artworkPath,
|
||||||
required this.sourceTag,
|
required this.sourceTag,
|
||||||
this.metadataState = 'unknown',
|
this.metadataState = 'unknown',
|
||||||
});
|
});
|
||||||
@@ -287,6 +290,9 @@ class _HomePageState extends BaseState<HomePage> {
|
|||||||
fileName: displayName,
|
fileName: displayName,
|
||||||
title: hasTitle ? title : null,
|
title: hasTitle ? title : null,
|
||||||
artist: artist.isNotEmpty ? artist : null,
|
artist: artist.isNotEmpty ? artist : null,
|
||||||
|
artworkPath: (row?['artwork_path'] as String?)?.trim().isNotEmpty == true
|
||||||
|
? (row!['artwork_path'] as String).trim()
|
||||||
|
: null,
|
||||||
sourceTag: folderName.isNotEmpty ? '($folderName)' : '',
|
sourceTag: folderName.isNotEmpty ? '($folderName)' : '',
|
||||||
metadataState: hasTitle ? 'success' : 'unknown',
|
metadataState: hasTitle ? 'success' : 'unknown',
|
||||||
));
|
));
|
||||||
@@ -771,18 +777,19 @@ class _HomePageState extends BaseState<HomePage> {
|
|||||||
duration: const Duration(milliseconds: 150),
|
duration: const Duration(milliseconds: 150),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
vertical: 6),
|
vertical: 2),
|
||||||
child: ListTile(
|
child: ListTile(
|
||||||
contentPadding: EdgeInsets.zero,
|
contentPadding: EdgeInsets.zero,
|
||||||
leading: const Icon(
|
visualDensity: VisualDensity.compact,
|
||||||
Icons.music_note,
|
leading: SongArtwork(
|
||||||
color: Colors.white38,
|
filePath: song.artworkPath,
|
||||||
size: 20,
|
size: 44,
|
||||||
|
fallbackIcon: Icons.music_note,
|
||||||
),
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
song.displayTitle,
|
song.displayTitle,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 17,
|
fontSize: 16,
|
||||||
fontWeight: FontWeight.w400,
|
fontWeight: FontWeight.w400,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
),
|
),
|
||||||
@@ -792,7 +799,7 @@ class _HomePageState extends BaseState<HomePage> {
|
|||||||
subtitle: Text(
|
subtitle: Text(
|
||||||
song.displaySubtitle,
|
song.displaySubtitle,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 13,
|
||||||
color: Colors.grey[400],
|
color: Colors.grey[400],
|
||||||
),
|
),
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
|
|||||||
@@ -351,7 +351,8 @@ class _WebDAVFileListPageState extends BaseState<WebDAVFileListPage> {
|
|||||||
|
|
||||||
if (item.isDirectory) {
|
if (item.isDirectory) {
|
||||||
return ListTile(
|
return ListTile(
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
contentPadding: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
leading: const Icon(
|
leading: const Icon(
|
||||||
Icons.folder_outlined,
|
Icons.folder_outlined,
|
||||||
color: Color(0xFFB8D4D0),
|
color: Color(0xFFB8D4D0),
|
||||||
@@ -397,7 +398,8 @@ class _WebDAVFileListPageState extends BaseState<WebDAVFileListPage> {
|
|||||||
].join(' · ');
|
].join(' · ');
|
||||||
|
|
||||||
return ListTile(
|
return ListTile(
|
||||||
contentPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
contentPadding: const EdgeInsets.symmetric(horizontal: 4),
|
||||||
|
visualDensity: VisualDensity.compact,
|
||||||
leading: SongArtwork(
|
leading: SongArtwork(
|
||||||
filePath: meta?['artwork_path'] as String?,
|
filePath: meta?['artwork_path'] as String?,
|
||||||
size: 44,
|
size: 44,
|
||||||
|
|||||||
Reference in New Issue
Block a user