opt: playall

Closes #450

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-03-16 17:28:51 +08:00
parent b07cf62bdd
commit b99cf4f629
7 changed files with 106 additions and 39 deletions

View File

@@ -23,6 +23,7 @@ class VideoCardH extends StatelessWidget {
this.showPubdate = false,
this.onTap,
this.onLongPress,
this.onViewLater,
});
final dynamic videoItem;
final String source;
@@ -32,6 +33,7 @@ class VideoCardH extends StatelessWidget {
final bool showPubdate;
final VoidCallback? onTap;
final VoidCallback? onLongPress;
final ValueChanged<int>? onViewLater;
@override
Widget build(BuildContext context) {
@@ -73,7 +75,7 @@ class VideoCardH extends StatelessWidget {
},
onTap: () async {
if (onTap != null) {
onTap?.call();
onTap!();
return;
}
if (type == 'ketang') {
@@ -89,13 +91,17 @@ class VideoCardH extends StatelessWidget {
try {
final int cid = videoItem.cid ??
await SearchHttp.ab2c(aid: aid, bvid: bvid);
Utils.toViewPage(
'bvid=$bvid&cid=$cid',
arguments: {
'videoItem': videoItem,
'heroTag': Utils.makeHeroTag(aid)
},
);
if (source == 'later') {
onViewLater!(cid);
} else {
Utils.toViewPage(
'bvid=$bvid&cid=$cid',
arguments: {
'videoItem': videoItem,
'heroTag': Utils.makeHeroTag(aid)
},
);
}
} catch (err) {
SmartDialog.showToast(err.toString());
}