现在正在修复首次启动点击跳曲问题与顺序播放的跳曲问题

This commit is contained in:
2026-08-27 22:54:18 +08:00
parent 2a29e30940
commit 9fec9b98c5
4 changed files with 69 additions and 52 deletions
+6 -11
View File
@@ -1,9 +1,6 @@
// lib/pages/webdav_file_list_page.dart
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../services/webdav_service.dart';
import '../services/playback_service.dart';
import '../services/audio_service.dart';
import '../constants/ui_constants.dart';
import '../base/base_state.dart';
import '../controllers/playback_controller.dart';
@@ -79,12 +76,11 @@ class _WebDAVFileListPageState extends BaseState<WebDAVFileListPage> {
);
}
// ============================================================
// 播放单首(点击歌曲
// ============================================================
// ============================================================
// 播放单首(使用 PlaybackController
// ============================================================
void _playSong(WebDAVItem file) async {
try {
// ⭐ 直接使用 PlaybackController 单例
await PlaybackController().playFromWebDAV(
directoryPath: _currentPath,
clickedSongPath: file.path,
@@ -112,12 +108,11 @@ class _WebDAVFileListPageState extends BaseState<WebDAVFileListPage> {
}
}
// ============================================================
// 全部播放
// ============================================================
// ============================================================
// 全部播放(使用 PlaybackController
// ============================================================
void _playAll() async {
try {
// ⭐ 全部播放使用 playAllFromWebDAV
await PlaybackController().playAllFromWebDAV(
directoryPath: _currentPath,
allItems: _items,