目前调通了120全局,准备开始介入播放层,在修bug

This commit is contained in:
2026-08-15 23:06:55 +08:00
parent 15683d0bab
commit 902788c736
11 changed files with 1096 additions and 235 deletions
+30 -18
View File
@@ -1,4 +1,3 @@
// lib/widgets/mini_player_bar.dart
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../services/audio_service.dart';
@@ -15,31 +14,40 @@ class MiniPlayerBar extends StatelessWidget {
height: 64,
decoration: BoxDecoration(
color: const Color(0xFF1A1F1E),
border:
const Border(top: BorderSide(color: Colors.white10, width: 0.5)),
boxShadow: [
BoxShadow(
color: Colors.black26,
blurRadius: 8,
offset: const Offset(0, -2)),
color: Colors.black.withOpacity(0.4),
blurRadius: 12,
offset: const Offset(0, -4),
),
],
// 顶部微渐变(轻阴影)
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Colors.transparent,
Colors.black.withOpacity(0.1),
],
stops: const [0.0, 1.0],
),
),
child: Row(
children: [
const SizedBox(width: 12),
// ---- 封面方图 ----
// 封面占位(56px
Container(
width: 44,
height: 44,
width: 48,
height: 48,
decoration: BoxDecoration(
color: const Color(0xFF2A3332),
borderRadius: BorderRadius.circular(6),
borderRadius: BorderRadius.circular(4),
),
child:
const Icon(Icons.music_note, color: Colors.white38, size: 22),
const Icon(Icons.music_note, color: Colors.white38, size: 24),
),
const SizedBox(width: 12),
// ---- 歌曲信息 ----
// 歌曲信息
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -48,20 +56,26 @@ class MiniPlayerBar extends StatelessWidget {
Text(
song.title,
style: const TextStyle(
fontSize: 14, fontWeight: FontWeight.w500),
fontSize: 15,
fontWeight: FontWeight.w500,
color: Colors.white,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
song.artist,
style: TextStyle(fontSize: 12, color: Colors.grey[400]),
style: TextStyle(
fontSize: 13,
color: Colors.grey[400],
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
],
),
),
// ---- 控制按钮:播放/暂停 + 展开列表 ----
// 控制按钮
IconButton(
icon: Icon(
service.isPlaying ? Icons.pause : Icons.play_arrow,
@@ -72,9 +86,7 @@ class MiniPlayerBar extends StatelessWidget {
IconButton(
icon:
const Icon(Icons.playlist_play_outlined, color: Colors.white54),
onPressed: () {
// 后续:展开当前播放列表
},
onPressed: () {},
),
const SizedBox(width: 4),
],