播放页部分调整,完整播放链路层级已打通
This commit is contained in:
+14
-14
@@ -2,15 +2,17 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import '../services/audio_service.dart';
|
||||
import '../main.dart'; // ✅ 导入 navigatorKey
|
||||
import 'playlist_page.dart'; // ✅ 导入 PlaylistPage
|
||||
import '../main.dart';
|
||||
import 'playlist_page.dart';
|
||||
|
||||
class PlayerPage extends StatefulWidget {
|
||||
final VoidCallback onClose;
|
||||
final VoidCallback onOpenPlaylist;
|
||||
|
||||
const PlayerPage({
|
||||
super.key,
|
||||
required this.onClose,
|
||||
required this.onOpenPlaylist,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -81,7 +83,7 @@ class _PlayerPageState extends State<PlayerPage> {
|
||||
elevation: 0,
|
||||
leading: IconButton(
|
||||
icon: const Icon(Icons.arrow_back_ios_new, color: Colors.white),
|
||||
onPressed: widget.onClose, // ✅ 使用回调关闭
|
||||
onPressed: widget.onClose,
|
||||
),
|
||||
title: const Text(
|
||||
'正在播放',
|
||||
@@ -93,17 +95,6 @@ class _PlayerPageState extends State<PlayerPage> {
|
||||
),
|
||||
centerTitle: true,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon:
|
||||
const Icon(Icons.playlist_play_outlined, color: Colors.white54),
|
||||
onPressed: () {
|
||||
navigatorKey.currentState?.push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => const PlaylistPage(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.more_vert, color: Colors.white54),
|
||||
onPressed: () {},
|
||||
@@ -309,6 +300,15 @@ class _PlayerPageState extends State<PlayerPage> {
|
||||
color: service.hasQueue ? Colors.white60 : Colors.grey[600],
|
||||
padding: const EdgeInsets.all(12),
|
||||
),
|
||||
IconButton(
|
||||
onPressed: widget.onOpenPlaylist,
|
||||
icon: const Icon(
|
||||
Icons.playlist_play_outlined,
|
||||
color: Color(0xFFB8D4D0),
|
||||
size: 26,
|
||||
),
|
||||
padding: const EdgeInsets.all(8),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user