fix: 稍后再看

This commit is contained in:
guozhigq
2023-08-15 10:08:17 +08:00
parent 1c59764500
commit 3c9a97181b
3 changed files with 76 additions and 68 deletions

View File

@ -16,12 +16,14 @@ class VideoCardH extends StatelessWidget {
final videoItem; final videoItem;
final Function()? longPress; final Function()? longPress;
final Function()? longPressEnd; final Function()? longPressEnd;
final String source;
const VideoCardH({ const VideoCardH({
Key? key, Key? key,
required this.videoItem, required this.videoItem,
this.longPress, this.longPress,
this.longPressEnd, this.longPressEnd,
this.source = 'normal',
}) : super(key: key); }) : super(key: key);
@override @override
@ -92,7 +94,7 @@ class VideoCardH extends StatelessWidget {
}, },
), ),
), ),
VideoContent(videoItem: videoItem) VideoContent(videoItem: videoItem, source: source)
], ],
), ),
); );
@ -107,7 +109,9 @@ class VideoCardH extends StatelessWidget {
class VideoContent extends StatelessWidget { class VideoContent extends StatelessWidget {
// ignore: prefer_typing_uninitialized_variables // ignore: prefer_typing_uninitialized_variables
final videoItem; final videoItem;
const VideoContent({super.key, required this.videoItem}); final String source;
const VideoContent(
{super.key, required this.videoItem, this.source = 'normal'});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -217,6 +221,7 @@ class VideoContent extends StatelessWidget {
// ), // ),
// ), // ),
// ), // ),
if (source == 'normal')
SizedBox( SizedBox(
width: 24, width: 24,
height: 24, height: 24,
@ -235,8 +240,8 @@ class VideoContent extends StatelessWidget {
<PopupMenuEntry<String>>[ <PopupMenuEntry<String>>[
PopupMenuItem<String>( PopupMenuItem<String>(
onTap: () async { onTap: () async {
var res = var res = await UserHttp.toViewLater(
await UserHttp.toViewLater(bvid: videoItem.bvid); bvid: videoItem.bvid);
SmartDialog.showToast(res['msg']); SmartDialog.showToast(res['msg']);
}, },
value: 'pause', value: 'pause',

View File

@ -210,6 +210,7 @@ class VideoContent extends StatelessWidget {
); );
}), }),
), ),
if (videoItem.goto == 'av')
SizedBox( SizedBox(
width: 24, width: 24,
height: 24, height: 24,
@ -228,8 +229,9 @@ class VideoContent extends StatelessWidget {
<PopupMenuEntry<String>>[ <PopupMenuEntry<String>>[
PopupMenuItem<String>( PopupMenuItem<String>(
onTap: () async { onTap: () async {
var res = int aid = videoItem.param;
await UserHttp.toViewLater(bvid: videoItem.bvid); var res = await UserHttp.toViewLater(
bvid: IdUtils.av2bv(aid));
SmartDialog.showToast(res['msg']); SmartDialog.showToast(res['msg']);
}, },
value: 'pause', value: 'pause',

View File

@ -65,6 +65,7 @@ class _LaterPageState extends State<LaterPage> {
delegate: SliverChildBuilderDelegate((context, index) { delegate: SliverChildBuilderDelegate((context, index) {
return VideoCardH( return VideoCardH(
videoItem: _laterController.laterList[index], videoItem: _laterController.laterList[index],
source: 'later',
); );
}, childCount: _laterController.laterList.length), }, childCount: _laterController.laterList.length),
), ),