mod: add bvid option

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2024-11-20 12:06:08 +08:00
parent cc3d264ebb
commit 5b02ca44f8

View File

@@ -1,3 +1,4 @@
import 'package:PiliPalaX/utils/utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
@@ -12,7 +13,7 @@ import '../../utils/storage.dart';
class VideoCustomAction {
String title;
String value;
Icon icon;
Widget icon;
VoidCallback? onTap;
VideoCustomAction(this.title, this.value, this.icon, this.onTap);
}
@@ -24,18 +25,38 @@ class VideoCustomActions {
VideoCustomActions(this.videoItem, this.context) {
actions = [
VideoCustomAction(
'稍后再看', 'pause', Icon(MdiIcons.clockTimeEightOutline, size: 16),
() async {
var res = await UserHttp.toViewLater(bvid: videoItem.bvid as String);
SmartDialog.showToast(res['msg']);
}),
VideoCustomAction('访问:${videoItem.owner.name}', 'visit',
Icon(MdiIcons.accountCircleOutline, size: 16), () async {
Get.toNamed('/member?mid=${videoItem.owner.mid}', arguments: {
// 'face': videoItem.owner.face,
'heroTag': '${videoItem.owner.mid}',
});
}),
videoItem.bvid,
'copy',
Stack(
children: [
Icon(MdiIcons.identifier, size: 16),
Icon(MdiIcons.circleOutline, size: 16),
],
),
() {
Utils.copyText(videoItem.bvid);
},
),
VideoCustomAction(
'稍后再看',
'pause',
Icon(MdiIcons.clockTimeEightOutline, size: 16),
() async {
var res = await UserHttp.toViewLater(bvid: videoItem.bvid as String);
SmartDialog.showToast(res['msg']);
},
),
VideoCustomAction(
'访问:${videoItem.owner.name}',
'visit',
Icon(MdiIcons.accountCircleOutline, size: 16),
() async {
Get.toNamed('/member?mid=${videoItem.owner.mid}', arguments: {
// 'face': videoItem.owner.face,
'heroTag': '${videoItem.owner.mid}',
});
},
),
VideoCustomAction(
'不感兴趣', 'dislike', Icon(MdiIcons.thumbDownOutline, size: 16),
() async {