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

View File

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

View File

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