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