mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
opt: video tool bar
Closes #528 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -95,6 +95,7 @@ class VideoDetailController extends GetxController
|
|||||||
// 默认记录历史记录
|
// 默认记录历史记录
|
||||||
bool enableHeart = true;
|
bool enableHeart = true;
|
||||||
Floating? floating;
|
Floating? floating;
|
||||||
|
late final headerCtrKey = GlobalKey<HeaderControlState>();
|
||||||
late PreferredSizeWidget headerControl;
|
late PreferredSizeWidget headerControl;
|
||||||
|
|
||||||
Box get setting => GStorage.setting;
|
Box get setting => GStorage.setting;
|
||||||
@@ -291,6 +292,7 @@ class VideoDetailController extends GetxController
|
|||||||
floating = Floating();
|
floating = Floating();
|
||||||
}
|
}
|
||||||
headerControl = HeaderControl(
|
headerControl = HeaderControl(
|
||||||
|
key: headerCtrKey,
|
||||||
controller: plPlayerController,
|
controller: plPlayerController,
|
||||||
videoDetailCtr: this,
|
videoDetailCtr: this,
|
||||||
floating: floating,
|
floating: floating,
|
||||||
|
|||||||
@@ -856,17 +856,19 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (videoDetailController.playedTime ==
|
|
||||||
null)
|
|
||||||
Align(
|
Align(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: PopupMenuButton<String>(
|
child: videoDetailController
|
||||||
|
.playedTime ==
|
||||||
|
null
|
||||||
|
? PopupMenuButton<String>(
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.more_vert,
|
Icons.more_vert,
|
||||||
color: themeData
|
color: themeData
|
||||||
.colorScheme.onSurface,
|
.colorScheme.onSurface,
|
||||||
),
|
),
|
||||||
onSelected: (String type) async {
|
onSelected:
|
||||||
|
(String type) async {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'later':
|
case 'later':
|
||||||
await videoIntroController
|
await videoIntroController
|
||||||
@@ -878,7 +880,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
SmartDialog.showToast(
|
SmartDialog.showToast(
|
||||||
'账号未登录');
|
'账号未登录');
|
||||||
} else {
|
} else {
|
||||||
Get.toNamed('/webview',
|
Get.toNamed(
|
||||||
|
'/webview',
|
||||||
parameters: {
|
parameters: {
|
||||||
'url':
|
'url':
|
||||||
'https://www.bilibili.com/appeal/?avid=${IdUtils.bv2av(videoDetailController.bvid)}&bvid=${videoDetailController.bvid}'
|
'https://www.bilibili.com/appeal/?avid=${IdUtils.bv2av(videoDetailController.bvid)}&bvid=${videoDetailController.bvid}'
|
||||||
@@ -887,12 +890,13 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
break;
|
break;
|
||||||
case 'note':
|
case 'note':
|
||||||
videoDetailController
|
videoDetailController
|
||||||
.showNoteList(context);
|
.showNoteList(
|
||||||
|
context);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
itemBuilder:
|
itemBuilder: (BuildContext
|
||||||
(BuildContext context) =>
|
context) =>
|
||||||
<PopupMenuEntry<String>>[
|
<PopupMenuEntry<String>>[
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<String>(
|
||||||
value: 'later',
|
value: 'later',
|
||||||
@@ -901,7 +905,8 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
if (videoDetailController
|
if (videoDetailController
|
||||||
.epId ==
|
.epId ==
|
||||||
null)
|
null)
|
||||||
const PopupMenuItem<String>(
|
const PopupMenuItem<
|
||||||
|
String>(
|
||||||
value: 'note',
|
value: 'note',
|
||||||
child: Text('查看笔记'),
|
child: Text('查看笔记'),
|
||||||
),
|
),
|
||||||
@@ -910,6 +915,32 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
child: Text('举报'),
|
child: Text('举报'),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
)
|
||||||
|
: SizedBox(
|
||||||
|
width: 42,
|
||||||
|
height: 34,
|
||||||
|
child: IconButton(
|
||||||
|
tooltip: "更多设置",
|
||||||
|
style: ButtonStyle(
|
||||||
|
padding:
|
||||||
|
WidgetStateProperty
|
||||||
|
.all(EdgeInsets
|
||||||
|
.zero),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
videoDetailController
|
||||||
|
.headerCtrKey
|
||||||
|
.currentState
|
||||||
|
?.showSettingSheet();
|
||||||
|
},
|
||||||
|
icon: Icon(
|
||||||
|
Icons.more_vert_outlined,
|
||||||
|
size: 19,
|
||||||
|
color: themeData
|
||||||
|
.colorScheme
|
||||||
|
.onSurface,
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -53,13 +53,13 @@ class HeaderControl extends StatefulWidget implements PreferredSizeWidget {
|
|||||||
final String heroTag;
|
final String heroTag;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<HeaderControl> createState() => _HeaderControlState();
|
State<HeaderControl> createState() => HeaderControlState();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Size get preferredSize => throw UnimplementedError();
|
Size get preferredSize => throw UnimplementedError();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HeaderControlState extends State<HeaderControl> {
|
class HeaderControlState extends State<HeaderControl> {
|
||||||
PlayUrlModel get videoInfo => videoDetailCtr.data;
|
PlayUrlModel get videoInfo => videoDetailCtr.data;
|
||||||
static const TextStyle subTitleStyle = TextStyle(fontSize: 12);
|
static const TextStyle subTitleStyle = TextStyle(fontSize: 12);
|
||||||
static const TextStyle titleStyle = TextStyle(fontSize: 14);
|
static const TextStyle titleStyle = TextStyle(fontSize: 14);
|
||||||
|
|||||||
Reference in New Issue
Block a user