diff --git a/lib/pages/player_page.dart b/lib/pages/player_page.dart index 2bb97f9..38b1bff 100644 --- a/lib/pages/player_page.dart +++ b/lib/pages/player_page.dart @@ -307,7 +307,8 @@ class _PlayerPageState extends BaseState { Widget _buildMainPage(AudioService service, Song song, bool isPlaying) { return Padding( - padding: const EdgeInsets.symmetric(horizontal: 24), + // 顶部留 16:与 AppBar/指示器拉开距离,避免封面贴着顶部 + padding: const EdgeInsets.fromLTRB(24, 16, 24, 0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -334,19 +335,38 @@ class _PlayerPageState extends BaseState { ), const SizedBox(height: 28), - // ---- 标题 / 艺术家 ---- - Text( - song.title, - style: const TextStyle( - fontSize: 24, - fontWeight: FontWeight.w600, - color: Colors.white, - height: 1.25, - ), - maxLines: 2, - overflow: TextOverflow.ellipsis, + // ---- 标题 / 艺术家(收藏心在标题右侧)---- + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: Text( + song.title, + style: const TextStyle( + fontSize: 24, + fontWeight: FontWeight.w600, + color: Colors.white, + height: 1.25, + ), + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ), + const SizedBox(width: 8), + IconButton( + onPressed: () => _toggleFavorite(song), + tooltip: '收藏', + icon: Icon( + _isFavorite ? Icons.favorite : Icons.favorite_border, + color: _isFavorite + ? const Color(0xFFE05C5C) + : Colors.white54, + size: 26, + ), + ), + ], ), - const SizedBox(height: 6), + const SizedBox(height: 2), Text( song.artist, style: TextStyle(fontSize: 14, color: Colors.grey[400]), @@ -641,15 +661,13 @@ class _PlayerPageState extends BaseState { color: service.hasQueue ? Colors.white70 : Colors.grey[700], ), IconButton( - onPressed: () => _toggleFavorite(song), + onPressed: service.togglePlayMode, icon: Icon( - _isFavorite ? Icons.favorite : Icons.favorite_border, - color: _isFavorite - ? const Color(0xFFE05C5C) - : Colors.white54, + service.playModeIcon, + color: const Color(0xFFB8D4D0), size: 26, ), - tooltip: '收藏', + tooltip: '播放模式', ), IconButton( onPressed: _openPlaylist,