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 'settings_page.dart';
|
||||
import '../database/song_database.dart';
|
||||
import '../widgets/song_artwork.dart';
|
||||
import 'webdav_file_list_page.dart';
|
||||
import '../constants/ui_constants.dart';
|
||||
import '../base/base_state.dart';
|
||||
@@ -18,6 +19,7 @@ class SongItem {
|
||||
final String fileName;
|
||||
final String? title;
|
||||
final String? artist;
|
||||
final String? artworkPath;
|
||||
final String sourceTag;
|
||||
final String metadataState;
|
||||
|
||||
@@ -26,6 +28,7 @@ class SongItem {
|
||||
required this.fileName,
|
||||
this.title,
|
||||
this.artist,
|
||||
this.artworkPath,
|
||||
required this.sourceTag,
|
||||
this.metadataState = 'unknown',
|
||||
});
|
||||
@@ -287,6 +290,9 @@ class _HomePageState extends BaseState<HomePage> {
|
||||
fileName: displayName,
|
||||
title: hasTitle ? title : 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)' : '',
|
||||
metadataState: hasTitle ? 'success' : 'unknown',
|
||||
));
|
||||
@@ -771,18 +777,19 @@ class _HomePageState extends BaseState<HomePage> {
|
||||
duration: const Duration(milliseconds: 150),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: 6),
|
||||
vertical: 2),
|
||||
child: ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
leading: const Icon(
|
||||
Icons.music_note,
|
||||
color: Colors.white38,
|
||||
size: 20,
|
||||
visualDensity: VisualDensity.compact,
|
||||
leading: SongArtwork(
|
||||
filePath: song.artworkPath,
|
||||
size: 44,
|
||||
fallbackIcon: Icons.music_note,
|
||||
),
|
||||
title: Text(
|
||||
song.displayTitle,
|
||||
style: const TextStyle(
|
||||
fontSize: 17,
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w400,
|
||||
color: Colors.white,
|
||||
),
|
||||
@@ -792,7 +799,7 @@ class _HomePageState extends BaseState<HomePage> {
|
||||
subtitle: Text(
|
||||
song.displaySubtitle,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontSize: 13,
|
||||
color: Colors.grey[400],
|
||||
),
|
||||
maxLines: 1,
|
||||
|
||||
@@ -351,7 +351,8 @@ class _WebDAVFileListPageState extends BaseState<WebDAVFileListPage> {
|
||||
|
||||
if (item.isDirectory) {
|
||||
return ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
visualDensity: VisualDensity.compact,
|
||||
leading: const Icon(
|
||||
Icons.folder_outlined,
|
||||
color: Color(0xFFB8D4D0),
|
||||
@@ -397,7 +398,8 @@ class _WebDAVFileListPageState extends BaseState<WebDAVFileListPage> {
|
||||
].join(' · ');
|
||||
|
||||
return ListTile(
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 4, vertical: 2),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 4),
|
||||
visualDensity: VisualDensity.compact,
|
||||
leading: SongArtwork(
|
||||
filePath: meta?['artwork_path'] as String?,
|
||||
size: 44,
|
||||
|
||||
Reference in New Issue
Block a user