feat: view invalid fav video
This commit is contained in:
@ -19,6 +19,7 @@ class FavVideoCardH extends StatelessWidget {
|
||||
final Function? callFn;
|
||||
final int? searchType;
|
||||
final String isOwner;
|
||||
final Function? viewInvalidVideoCb;
|
||||
|
||||
const FavVideoCardH({
|
||||
Key? key,
|
||||
@ -26,6 +27,7 @@ class FavVideoCardH extends StatelessWidget {
|
||||
this.callFn,
|
||||
this.searchType,
|
||||
required this.isOwner,
|
||||
this.viewInvalidVideoCb,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@ -36,6 +38,10 @@ class FavVideoCardH extends StatelessWidget {
|
||||
return InkWell(
|
||||
onTap: () async {
|
||||
// int? seasonId;
|
||||
if (videoItem.title == '已失效视频') {
|
||||
viewInvalidVideoCb?.call();
|
||||
return;
|
||||
}
|
||||
String? epId;
|
||||
if (videoItem.ogv != null &&
|
||||
(videoItem.ogv['type_name'] == '番剧' ||
|
||||
@ -65,11 +71,17 @@ class FavVideoCardH extends StatelessWidget {
|
||||
epId != null ? SearchType.media_bangumi : SearchType.video,
|
||||
});
|
||||
},
|
||||
onLongPress: () => imageSaveDialog(
|
||||
context,
|
||||
videoItem,
|
||||
SmartDialog.dismiss,
|
||||
),
|
||||
onLongPress: () {
|
||||
if (videoItem.title == '已失效视频') {
|
||||
SmartDialog.showToast('视频已失效');
|
||||
return;
|
||||
}
|
||||
imageSaveDialog(
|
||||
context,
|
||||
videoItem,
|
||||
SmartDialog.dismiss,
|
||||
);
|
||||
},
|
||||
child: Column(
|
||||
children: [
|
||||
Padding(
|
||||
|
||||
51
lib/pages/fav_detail/widget/invalid_video_card.dart
Normal file
51
lib/pages/fav_detail/widget/invalid_video_card.dart
Normal file
@ -0,0 +1,51 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:pilipala/common/widgets/network_img_layer.dart';
|
||||
import 'package:pilipala/models/common/invalid_video.dart';
|
||||
|
||||
class InvalidVideoCard extends StatelessWidget {
|
||||
const InvalidVideoCard({required this.videoInfo, Key? key}) : super(key: key);
|
||||
final InvalidVideoModel videoInfo;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
const TextStyle textStyle = TextStyle(fontSize: 14.0);
|
||||
return Padding(
|
||||
padding: EdgeInsets.fromLTRB(
|
||||
12,
|
||||
14,
|
||||
12,
|
||||
MediaQuery.of(context).padding.bottom + 20,
|
||||
),
|
||||
child: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
double maxWidth = constraints.maxWidth;
|
||||
double maxHeight = maxWidth * 9 / 16;
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
width: maxWidth,
|
||||
height: maxHeight,
|
||||
src: videoInfo.pic,
|
||||
radius: 20,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
SelectableText('标题:${videoInfo.title}', style: textStyle),
|
||||
SelectableText('作者:${videoInfo.author}', style: textStyle),
|
||||
SelectableText('创建时间:${videoInfo.createdAt}', style: textStyle),
|
||||
SelectableText('上次更新时间:${videoInfo.lastupdate}',
|
||||
style: textStyle),
|
||||
SelectableText('分类:${videoInfo.typename}', style: textStyle),
|
||||
SelectableText('投币:${videoInfo.coins}', style: textStyle),
|
||||
SelectableText('收藏:${videoInfo.favorites}', style: textStyle),
|
||||
SelectableText('标签:${videoInfo.tag}', style: textStyle),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user