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,62 +856,93 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (videoDetailController.playedTime ==
|
Align(
|
||||||
null)
|
alignment: Alignment.centerRight,
|
||||||
Align(
|
child: videoDetailController
|
||||||
alignment: Alignment.centerRight,
|
.playedTime ==
|
||||||
child: PopupMenuButton<String>(
|
null
|
||||||
icon: Icon(
|
? PopupMenuButton<String>(
|
||||||
Icons.more_vert,
|
icon: Icon(
|
||||||
color: themeData
|
Icons.more_vert,
|
||||||
.colorScheme.onSurface,
|
color: themeData
|
||||||
),
|
.colorScheme.onSurface,
|
||||||
onSelected: (String type) async {
|
),
|
||||||
switch (type) {
|
onSelected:
|
||||||
case 'later':
|
(String type) async {
|
||||||
await videoIntroController
|
switch (type) {
|
||||||
.viewLater();
|
case 'later':
|
||||||
break;
|
await videoIntroController
|
||||||
case 'report':
|
.viewLater();
|
||||||
if (!Accounts
|
break;
|
||||||
.main.isLogin) {
|
case 'report':
|
||||||
SmartDialog.showToast(
|
if (!Accounts
|
||||||
'账号未登录');
|
.main.isLogin) {
|
||||||
} else {
|
SmartDialog.showToast(
|
||||||
Get.toNamed('/webview',
|
'账号未登录');
|
||||||
parameters: {
|
} else {
|
||||||
'url':
|
Get.toNamed(
|
||||||
'https://www.bilibili.com/appeal/?avid=${IdUtils.bv2av(videoDetailController.bvid)}&bvid=${videoDetailController.bvid}'
|
'/webview',
|
||||||
});
|
parameters: {
|
||||||
}
|
'url':
|
||||||
break;
|
'https://www.bilibili.com/appeal/?avid=${IdUtils.bv2av(videoDetailController.bvid)}&bvid=${videoDetailController.bvid}'
|
||||||
case 'note':
|
});
|
||||||
videoDetailController
|
}
|
||||||
.showNoteList(context);
|
break;
|
||||||
break;
|
case 'note':
|
||||||
}
|
videoDetailController
|
||||||
},
|
.showNoteList(
|
||||||
itemBuilder:
|
context);
|
||||||
(BuildContext context) =>
|
break;
|
||||||
<PopupMenuEntry<String>>[
|
}
|
||||||
const PopupMenuItem<String>(
|
},
|
||||||
value: 'later',
|
itemBuilder: (BuildContext
|
||||||
child: Text('稍后再看'),
|
context) =>
|
||||||
),
|
<PopupMenuEntry<String>>[
|
||||||
if (videoDetailController
|
const PopupMenuItem<String>(
|
||||||
.epId ==
|
value: 'later',
|
||||||
null)
|
child: Text('稍后再看'),
|
||||||
const PopupMenuItem<String>(
|
),
|
||||||
value: 'note',
|
if (videoDetailController
|
||||||
child: Text('查看笔记'),
|
.epId ==
|
||||||
|
null)
|
||||||
|
const PopupMenuItem<
|
||||||
|
String>(
|
||||||
|
value: 'note',
|
||||||
|
child: Text('查看笔记'),
|
||||||
|
),
|
||||||
|
const PopupMenuItem<String>(
|
||||||
|
value: 'report',
|
||||||
|
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,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
const PopupMenuItem<String>(
|
|
||||||
value: 'report',
|
|
||||||
child: Text('举报'),
|
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -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