暂时把bug先处理掉了,准备尝试实现最小播放目标

This commit is contained in:
2026-08-15 23:20:54 +08:00
parent 902788c736
commit 699ab7ce86
11 changed files with 313 additions and 130 deletions
-53
View File
@@ -1,53 +0,0 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../models/song_model.dart';
import '../services/audio_service.dart';
import '../widgets/full_player_page.dart';
class PlaylistPage extends StatelessWidget {
const PlaylistPage({super.key});
@override
Widget build(BuildContext context) {
final songs = Song.placeholderSongs; // 后续替换成 WebDAV/SAF 列表
return Scaffold(
appBar: AppBar(
title: const Text('我的清听'),
actions: [
IconButton(
icon: const Icon(Icons.shuffle),
onPressed: () {}, // 以后实现随机
),
],
),
body: ListView.builder(
padding: const EdgeInsets.symmetric(vertical: 8),
itemCount: songs.length,
itemBuilder: (context, index) {
final song = songs[index];
return ListTile(
leading: const CircleAvatar(
backgroundColor: Color(0xFF2A3332),
child: Icon(Icons.audiotrack, size: 20, color: Colors.white54),
),
title: Text(song.title,
style: const TextStyle(fontWeight: FontWeight.w500)),
subtitle: Text(song.artist,
style: TextStyle(color: Colors.grey[400], fontSize: 13)),
trailing: const Icon(Icons.more_vert, color: Colors.grey),
onTap: () {
// 1. 先更新服务,显示迷你条
context.read<AudioService>().playSong(song);
// 2. 再跳转全屏播放器
Navigator.push(
context,
MaterialPageRoute(builder: (_) => const FullPlayerPage()),
);
},
);
},
),
);
}
}
+1 -1
View File
@@ -37,7 +37,7 @@ class _WebDAVSetupPageState extends State<WebDAVSetupPage> {
_isConnected = hasCred;
_statusText = hasCred ? '已连接' : '未连接';
if (hasCred) {
_baseUrlController.text = WebDAVService.instance._baseUrl ?? '';
_baseUrlController.text = WebDAVService.instance.baseUrl ?? '';
// 用户名不显示,保持隐私
}
});