mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
chore: clean up
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -176,11 +176,6 @@ class VideoIntroController extends GetxController {
|
||||
lastPlayCid.value == 0) {
|
||||
lastPlayCid.value = videoDetail.value.pages!.first.cid!;
|
||||
}
|
||||
// Get.find<VideoDetailController>(tag: heroTag).tabs.value = [
|
||||
// '简介',
|
||||
// '评论 ${result['data']!.stat!.reply}'
|
||||
// ];
|
||||
// 获取到粉丝数再返回
|
||||
queryUserStat();
|
||||
} else {
|
||||
SmartDialog.showToast(
|
||||
@@ -274,12 +269,10 @@ class VideoIntroController extends GetxController {
|
||||
return;
|
||||
}
|
||||
if (videoDetail.value.stat?.like == null) {
|
||||
// not init
|
||||
return;
|
||||
}
|
||||
var result = await VideoHttp.likeVideo(bvid: bvid, type: !hasLike.value);
|
||||
if (result['status']) {
|
||||
// hasLike.value = result["data"] == 1 ? true : false;
|
||||
if (!hasLike.value) {
|
||||
SmartDialog.showToast(result['data']['toast']);
|
||||
hasLike.value = true;
|
||||
@@ -303,7 +296,6 @@ class VideoIntroController extends GetxController {
|
||||
var result =
|
||||
await VideoHttp.dislikeVideo(bvid: bvid, type: !hasDislike.value);
|
||||
if (result['status']) {
|
||||
// hasLike.value = result["data"] == 1 ? true : false;
|
||||
if (!hasDislike.value) {
|
||||
SmartDialog.showToast('点踩成功');
|
||||
hasDislike.value = true;
|
||||
@@ -312,7 +304,6 @@ class VideoIntroController extends GetxController {
|
||||
SmartDialog.showToast('取消踩');
|
||||
hasDislike.value = false;
|
||||
}
|
||||
// hasDislike.refresh();
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
}
|
||||
@@ -435,8 +426,6 @@ class VideoIntroController extends GetxController {
|
||||
Get.back();
|
||||
hasFav.value =
|
||||
addMediaIdsNew.isNotEmpty || favIds?.length != delMediaIdsNew.length;
|
||||
// 重新获取收藏状态
|
||||
// await queryHasFavVideo();
|
||||
SmartDialog.showToast('操作成功');
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
@@ -581,14 +570,6 @@ class VideoIntroController extends GetxController {
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
// MemberController _ = Get.put<MemberController>(MemberController(mid: mid),
|
||||
// tag: mid.toString());
|
||||
// await _.getInfo();
|
||||
// if (context.mounted) await _.actionRelationMod(context);
|
||||
// followStatus['attribute'] = _.attribute.value;
|
||||
// followStatus.refresh();
|
||||
// Get.delete<MemberController>(tag: mid.toString());
|
||||
}
|
||||
|
||||
// 修改分P或番剧分集
|
||||
@@ -678,10 +659,6 @@ class VideoIntroController extends GetxController {
|
||||
bvid: bvid,
|
||||
cid: lastPlayCid.value,
|
||||
);
|
||||
// dynamic result = await GrpcRepo.playerOnline(
|
||||
// aid: IdUtils.bv2av(bvid),
|
||||
// cid: lastPlayCid.value,
|
||||
// );
|
||||
if (result['status']) {
|
||||
total.value = result['data'];
|
||||
}
|
||||
|
||||
@@ -54,7 +54,6 @@ class _VideoIntroPanelState extends State<VideoIntroPanel>
|
||||
with AutomaticKeepAliveClientMixin {
|
||||
late VideoIntroController videoIntroController;
|
||||
|
||||
// 添加页面缓存
|
||||
@override
|
||||
bool get wantKeepAlive => true;
|
||||
|
||||
@@ -241,11 +240,9 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
return;
|
||||
}
|
||||
feedBack();
|
||||
// widget.showIntroDetail();
|
||||
videoIntroController.expandableCtr?.toggle();
|
||||
}
|
||||
|
||||
// 用户主页
|
||||
onPushMember() {
|
||||
feedBack();
|
||||
int? mid = !widget.loadingStatus
|
||||
@@ -256,16 +253,8 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
_horizontalMemberPage) {
|
||||
widget.onShowMemberPage(mid);
|
||||
} else {
|
||||
// memberHeroTag = Utils.makeHeroTag(mid);
|
||||
// String face = !loadingStatus
|
||||
// ? videoDetail.owner!.face
|
||||
// : videoItem['owner'].face;
|
||||
Get.toNamed(
|
||||
'/member?mid=$mid&from_view_aid=${videoDetailCtr.oid.value}',
|
||||
// arguments: {
|
||||
// 'face': face,
|
||||
// 'heroTag': memberHeroTag,
|
||||
// },
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -273,7 +262,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final ThemeData t = Theme.of(context);
|
||||
final ThemeData themeData = Theme.of(context);
|
||||
return SliverLayoutBuilder(
|
||||
builder: (BuildContext context, SliverConstraints constraints) {
|
||||
bool isHorizontal = context.orientation == Orientation.landscape &&
|
||||
@@ -297,266 +286,242 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
onTap: () {},
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: videoItem['staff'] == null
|
||||
? Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
if (videoItem['staff'] == null) ...[
|
||||
Expanded(
|
||||
child: Align(
|
||||
alignment: Alignment.centerLeft,
|
||||
child: GestureDetector(
|
||||
onTap: onPushMember,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: onPushMember,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Row(
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.center,
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Obx(
|
||||
() => Avatar(
|
||||
avatar: videoIntroController
|
||||
.userStat
|
||||
.value['card']?['face'] ??
|
||||
'',
|
||||
size: 35,
|
||||
isVip: (videoIntroController
|
||||
.userStat
|
||||
.value['card']
|
||||
?['vip']?['status'] ??
|
||||
-1) >
|
||||
0,
|
||||
officialType: videoIntroController
|
||||
.userStat.value['card']
|
||||
?['official_verify']?['type'],
|
||||
garbPendantImage:
|
||||
videoIntroController.userStat
|
||||
.value['card']
|
||||
?['pendant']?['image'],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Obx(
|
||||
() => Text(
|
||||
videoIntroController.userStat
|
||||
.value['card']
|
||||
?['name'] ??
|
||||
"",
|
||||
maxLines: 1,
|
||||
overflow:
|
||||
TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: (videoIntroController
|
||||
.userStat
|
||||
.value['card']?['vip']
|
||||
?[
|
||||
'status'] ??
|
||||
-1) >
|
||||
0 &&
|
||||
videoIntroController
|
||||
.userStat
|
||||
.value['card']
|
||||
?[
|
||||
'vip']?['type'] ==
|
||||
2
|
||||
? context.vipColor
|
||||
: null,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 0),
|
||||
Obx(
|
||||
() => Text(
|
||||
'${Utils.numFormat(videoIntroController.userStat.value['follower'])}粉丝 ${videoIntroController.userStat.value['archive_count'] != null ? '${Utils.numFormat(videoIntroController.userStat.value['archive_count'])}视频' : ''}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
t.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
Obx(
|
||||
() => Avatar(
|
||||
avatar: videoIntroController.userStat
|
||||
.value['card']?['face'] ??
|
||||
'',
|
||||
size: 35,
|
||||
isVip: (videoIntroController
|
||||
.userStat.value['card']
|
||||
?['vip']?['status'] ??
|
||||
-1) >
|
||||
0,
|
||||
officialType: videoIntroController
|
||||
.userStat.value['card']
|
||||
?['official_verify']?['type'],
|
||||
garbPendantImage: videoIntroController
|
||||
.userStat.value['card']
|
||||
?['pendant']?['image'],
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
followButton(context, t),
|
||||
],
|
||||
)
|
||||
: SelfSizedHorizontalList(
|
||||
gapSize: 25,
|
||||
itemCount: videoItem['staff'].length,
|
||||
childBuilder: (index) => GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
int? ownerMid = !widget.loadingStatus
|
||||
? videoDetail.owner?.mid
|
||||
: videoItem['owner']?.mid;
|
||||
if (videoItem['staff'][index].mid ==
|
||||
ownerMid &&
|
||||
context.orientation ==
|
||||
Orientation.landscape &&
|
||||
_horizontalMemberPage) {
|
||||
widget.onShowMemberPage(ownerMid);
|
||||
} else {
|
||||
Get.toNamed(
|
||||
'/member?mid=${videoItem['staff'][index].mid}&from_view_aid=${videoDetailCtr.oid.value}',
|
||||
// arguments: {
|
||||
// 'face':
|
||||
// videoItem['staff'][index].face,
|
||||
// 'heroTag': Utils.makeHeroTag(
|
||||
// videoItem['staff'][index].mid),
|
||||
// },
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
const SizedBox(width: 10),
|
||||
Column(
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
type: 'avatar',
|
||||
src: videoItem['staff'][index]
|
||||
.face,
|
||||
width: 35,
|
||||
height: 35,
|
||||
fadeInDuration: Duration.zero,
|
||||
fadeOutDuration: Duration.zero,
|
||||
),
|
||||
if ((videoItem['staff'][index]
|
||||
.official?['type'] ??
|
||||
-1) !=
|
||||
-1)
|
||||
Positioned(
|
||||
right: -2,
|
||||
bottom: -2,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.surface,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.offline_bolt,
|
||||
color: videoItem['staff']
|
||||
[index]
|
||||
.official?[
|
||||
'type'] ==
|
||||
0
|
||||
? Colors.yellow
|
||||
: Colors
|
||||
.lightBlueAccent,
|
||||
size: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: -6,
|
||||
child: Obx(() => videoIntroController
|
||||
.staffRelations[
|
||||
'status'] ==
|
||||
true &&
|
||||
Obx(
|
||||
() => Text(
|
||||
videoIntroController.userStat
|
||||
.value['card']?['name'] ??
|
||||
"",
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: (videoIntroController.userStat
|
||||
.value[
|
||||
'card']?['vip']
|
||||
?['status'] ??
|
||||
-1) >
|
||||
0 &&
|
||||
videoIntroController
|
||||
.staffRelations[
|
||||
'${videoItem['staff'][index].mid}'] ==
|
||||
null
|
||||
? Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
customBorder:
|
||||
const CircleBorder(),
|
||||
onTap: () {
|
||||
RequestUtils
|
||||
.actionRelationMod(
|
||||
context: context,
|
||||
mid: videoItem[
|
||||
'staff']
|
||||
[index]
|
||||
.mid,
|
||||
isFollow: false,
|
||||
callback: (val) {
|
||||
videoIntroController
|
||||
.staffRelations[
|
||||
'${videoItem['staff'][index].mid}'] = true;
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Ink(
|
||||
padding:
|
||||
const EdgeInsets
|
||||
.all(2),
|
||||
decoration:
|
||||
BoxDecoration(
|
||||
color: Theme.of(
|
||||
context)
|
||||
.colorScheme
|
||||
.secondaryContainer,
|
||||
shape:
|
||||
BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
MdiIcons.plus,
|
||||
size: 16,
|
||||
color: Theme.of(
|
||||
context)
|
||||
.colorScheme
|
||||
.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink()),
|
||||
.userStat
|
||||
.value['card']
|
||||
?[
|
||||
'vip']?['type'] ==
|
||||
2
|
||||
? context.vipColor
|
||||
: null,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
videoItem['staff'][index].name,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: videoItem['staff'][index]
|
||||
.vip
|
||||
.status >
|
||||
0 &&
|
||||
videoItem['staff']
|
||||
[index]
|
||||
.vip
|
||||
.type ==
|
||||
2
|
||||
? context.vipColor
|
||||
: null,
|
||||
),
|
||||
const SizedBox(height: 0),
|
||||
Obx(
|
||||
() => Text(
|
||||
'${Utils.numFormat(videoIntroController.userStat.value['follower'])}粉丝 ${videoIntroController.userStat.value['archive_count'] != null ? '${Utils.numFormat(videoIntroController.userStat.value['archive_count'])}视频' : ''}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color:
|
||||
themeData.colorScheme.outline,
|
||||
),
|
||||
Text(
|
||||
videoItem['staff'][index].title,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.outline,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
followButton(context, themeData),
|
||||
] else
|
||||
Expanded(
|
||||
child: SelfSizedHorizontalList(
|
||||
gapSize: 25,
|
||||
itemCount: videoItem['staff'].length,
|
||||
childBuilder: (index) => GestureDetector(
|
||||
behavior: HitTestBehavior.opaque,
|
||||
onTap: () {
|
||||
int? ownerMid = !widget.loadingStatus
|
||||
? videoDetail.owner?.mid
|
||||
: videoItem['owner']?.mid;
|
||||
if (videoItem['staff'][index].mid ==
|
||||
ownerMid &&
|
||||
context.orientation ==
|
||||
Orientation.landscape &&
|
||||
_horizontalMemberPage) {
|
||||
widget.onShowMemberPage(ownerMid);
|
||||
} else {
|
||||
Get.toNamed(
|
||||
'/member?mid=${videoItem['staff'][index].mid}&from_view_aid=${videoDetailCtr.oid.value}',
|
||||
);
|
||||
}
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
NetworkImgLayer(
|
||||
type: 'avatar',
|
||||
src: videoItem['staff'][index].face,
|
||||
width: 35,
|
||||
height: 35,
|
||||
fadeInDuration: Duration.zero,
|
||||
fadeOutDuration: Duration.zero,
|
||||
),
|
||||
if ((videoItem['staff'][index]
|
||||
.official?['type'] ??
|
||||
-1) !=
|
||||
-1)
|
||||
Positioned(
|
||||
right: -2,
|
||||
bottom: -2,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.surface,
|
||||
),
|
||||
child: Icon(
|
||||
Icons.offline_bolt,
|
||||
color: videoItem['staff'][index]
|
||||
.official?[
|
||||
'type'] ==
|
||||
0
|
||||
? Colors.yellow
|
||||
: Colors.lightBlueAccent,
|
||||
size: 14,
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 0,
|
||||
right: -6,
|
||||
child: Obx(() => videoIntroController
|
||||
.staffRelations[
|
||||
'status'] ==
|
||||
true &&
|
||||
videoIntroController
|
||||
.staffRelations[
|
||||
'${videoItem['staff'][index].mid}'] ==
|
||||
null
|
||||
? Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
customBorder:
|
||||
const CircleBorder(),
|
||||
onTap: () {
|
||||
RequestUtils
|
||||
.actionRelationMod(
|
||||
context: context,
|
||||
mid: videoItem['staff']
|
||||
[index]
|
||||
.mid,
|
||||
isFollow: false,
|
||||
callback: (val) {
|
||||
videoIntroController
|
||||
.staffRelations[
|
||||
'${videoItem['staff'][index].mid}'] = true;
|
||||
},
|
||||
);
|
||||
},
|
||||
child: Ink(
|
||||
padding:
|
||||
const EdgeInsets.all(
|
||||
2),
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.secondaryContainer,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
MdiIcons.plus,
|
||||
size: 16,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.onSecondaryContainer,
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink()),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment:
|
||||
CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
videoItem['staff'][index].name,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: videoItem['staff'][index]
|
||||
.vip
|
||||
.status >
|
||||
0 &&
|
||||
videoItem['staff'][index]
|
||||
.vip
|
||||
.type ==
|
||||
2
|
||||
? context.vipColor
|
||||
: null,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
videoItem['staff'][index].title,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.outline,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (isHorizontal) ...[
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
@@ -603,7 +568,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
value: Utils.numFormat(!widget.loadingStatus
|
||||
? videoDetail.stat?.view ?? '-'
|
||||
: videoItem['stat']?.view ?? '-'),
|
||||
textColor: t.colorScheme.outline,
|
||||
textColor: themeData.colorScheme.outline,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
StatDanMu(
|
||||
@@ -612,7 +577,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
value: Utils.numFormat(!widget.loadingStatus
|
||||
? videoDetail.stat?.danmaku ?? '-'
|
||||
: videoItem['stat']?.danmu ?? '-'),
|
||||
textColor: t.colorScheme.outline,
|
||||
textColor: themeData.colorScheme.outline,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Text(
|
||||
@@ -623,7 +588,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
formatType: 'detail'),
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: t.colorScheme.outline,
|
||||
color: themeData.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
if (MineController.anonymity.value) ...<Widget>[
|
||||
@@ -631,7 +596,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
Icon(
|
||||
MdiIcons.incognito,
|
||||
size: 15,
|
||||
color: t.colorScheme.outline,
|
||||
color: themeData.colorScheme.outline,
|
||||
semanticLabel: '无痕',
|
||||
),
|
||||
],
|
||||
@@ -642,7 +607,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
'${videoIntroController.total.value}人在看',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: t.colorScheme.outline,
|
||||
color: themeData.colorScheme.outline,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -736,7 +701,6 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
SelectableText.rich(
|
||||
style: const TextStyle(
|
||||
height: 1.4,
|
||||
// fontSize: 13,
|
||||
),
|
||||
TextSpan(
|
||||
children: [
|
||||
@@ -798,16 +762,6 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
),
|
||||
),
|
||||
),
|
||||
// 点赞收藏转发 布局样式1
|
||||
// SingleChildScrollView(
|
||||
// padding: const EdgeInsets.only(top: 7, bottom: 7),
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// child: actionRow(
|
||||
// context,
|
||||
// videoIntroController,
|
||||
// videoDetailCtr,
|
||||
// ),
|
||||
// ),
|
||||
// 点赞收藏转发 布局样式2
|
||||
if (!isHorizontal) ...[
|
||||
const SizedBox(height: 8),
|
||||
@@ -872,7 +826,7 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
switch (attr) {
|
||||
1 => '悄悄关注',
|
||||
2 => '已关注',
|
||||
6 => '已互关',
|
||||
4 || 6 => '已互关',
|
||||
128 => '已拉黑',
|
||||
-10 => '特别关注',
|
||||
_ => '关注'
|
||||
@@ -886,112 +840,108 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
|
||||
Widget actionGrid(
|
||||
BuildContext context, VideoIntroController videoIntroController) {
|
||||
return LayoutBuilder(
|
||||
builder: (BuildContext context, BoxConstraints constraints) {
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(top: 1),
|
||||
height: 48,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsUp),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp),
|
||||
onTap: () => handleState(videoIntroController.actionLikeVideo),
|
||||
onLongPress: () =>
|
||||
handleState(videoIntroController.actionOneThree),
|
||||
selectStatus: videoIntroController.hasLike.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '点赞',
|
||||
text: !widget.loadingStatus
|
||||
? Utils.numFormat(videoDetail.stat!.like!)
|
||||
: '-',
|
||||
needAnim: true,
|
||||
hasTriple: videoIntroController.hasLike.value &&
|
||||
videoIntroController.hasCoin &&
|
||||
videoIntroController.hasFav.value,
|
||||
callBack: (start) {
|
||||
if (start) {
|
||||
HapticFeedback.lightImpact();
|
||||
_coinKey.currentState?.controller?.forward();
|
||||
_favKey.currentState?.controller?.forward();
|
||||
} else {
|
||||
_coinKey.currentState?.controller?.reverse();
|
||||
_favKey.currentState?.controller?.reverse();
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsDown),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsDown),
|
||||
onTap: () =>
|
||||
handleState(videoIntroController.actionDislikeVideo),
|
||||
selectStatus: videoIntroController.hasDislike.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '点踩',
|
||||
text: "点踩",
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
key: _coinKey,
|
||||
icon: const Icon(FontAwesomeIcons.b),
|
||||
selectIcon: const Icon(FontAwesomeIcons.b),
|
||||
onTap: () => handleState(videoIntroController.actionCoinVideo),
|
||||
selectStatus: videoIntroController.hasCoin,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '投币',
|
||||
text: !widget.loadingStatus
|
||||
? Utils.numFormat(videoDetail.stat!.coin!)
|
||||
: '-',
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
key: _favKey,
|
||||
icon: const Icon(FontAwesomeIcons.star),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidStar),
|
||||
onTap: () => videoIntroController.showFavBottomSheet(context),
|
||||
onLongPress: () => videoIntroController
|
||||
.showFavBottomSheet(context, type: 'longPress'),
|
||||
selectStatus: videoIntroController.hasFav.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '收藏',
|
||||
text: !widget.loadingStatus
|
||||
? Utils.numFormat(videoDetail.stat!.favorite!)
|
||||
: '-',
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.clock),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidClock),
|
||||
onTap: () => handleState(videoIntroController.viewLater),
|
||||
selectStatus: videoIntroController.hasLater.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '再看',
|
||||
text: '再看',
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.shareFromSquare),
|
||||
onTap: () => videoIntroController.actionShareVideo(context),
|
||||
selectStatus: false,
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(top: 1),
|
||||
height: 48,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
children: <Widget>[
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsUp),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsUp),
|
||||
onTap: () => handleState(videoIntroController.actionLikeVideo),
|
||||
onLongPress: () =>
|
||||
handleState(videoIntroController.actionOneThree),
|
||||
selectStatus: videoIntroController.hasLike.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '分享',
|
||||
semanticsLabel: '点赞',
|
||||
text: !widget.loadingStatus
|
||||
? Utils.numFormat(videoDetail.stat!.share!)
|
||||
: '分享',
|
||||
? Utils.numFormat(videoDetail.stat!.like!)
|
||||
: '-',
|
||||
needAnim: true,
|
||||
hasTriple: videoIntroController.hasLike.value &&
|
||||
videoIntroController.hasCoin &&
|
||||
videoIntroController.hasFav.value,
|
||||
callBack: (start) {
|
||||
if (start) {
|
||||
HapticFeedback.lightImpact();
|
||||
_coinKey.currentState?.controller?.forward();
|
||||
_favKey.currentState?.controller?.forward();
|
||||
} else {
|
||||
_coinKey.currentState?.controller?.reverse();
|
||||
_favKey.currentState?.controller?.reverse();
|
||||
}
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
});
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsDown),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidThumbsDown),
|
||||
onTap: () => handleState(videoIntroController.actionDislikeVideo),
|
||||
selectStatus: videoIntroController.hasDislike.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '点踩',
|
||||
text: "点踩",
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
key: _coinKey,
|
||||
icon: const Icon(FontAwesomeIcons.b),
|
||||
selectIcon: const Icon(FontAwesomeIcons.b),
|
||||
onTap: () => handleState(videoIntroController.actionCoinVideo),
|
||||
selectStatus: videoIntroController.hasCoin,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '投币',
|
||||
text: !widget.loadingStatus
|
||||
? Utils.numFormat(videoDetail.stat!.coin!)
|
||||
: '-',
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
key: _favKey,
|
||||
icon: const Icon(FontAwesomeIcons.star),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidStar),
|
||||
onTap: () => videoIntroController.showFavBottomSheet(context),
|
||||
onLongPress: () => videoIntroController
|
||||
.showFavBottomSheet(context, type: 'longPress'),
|
||||
selectStatus: videoIntroController.hasFav.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '收藏',
|
||||
text: !widget.loadingStatus
|
||||
? Utils.numFormat(videoDetail.stat!.favorite!)
|
||||
: '-',
|
||||
needAnim: true,
|
||||
),
|
||||
),
|
||||
Obx(
|
||||
() => ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.clock),
|
||||
selectIcon: const Icon(FontAwesomeIcons.solidClock),
|
||||
onTap: () => handleState(videoIntroController.viewLater),
|
||||
selectStatus: videoIntroController.hasLater.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '再看',
|
||||
text: '再看',
|
||||
),
|
||||
),
|
||||
ActionItem(
|
||||
icon: const Icon(FontAwesomeIcons.shareFromSquare),
|
||||
onTap: () => videoIntroController.actionShareVideo(context),
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
semanticsLabel: '分享',
|
||||
text: !widget.loadingStatus
|
||||
? Utils.numFormat(videoDetail.stat!.share!)
|
||||
: '分享',
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget actionRow(
|
||||
@@ -999,63 +949,66 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
VideoIntroController videoIntroController,
|
||||
VideoDetailController videoDetailCtr,
|
||||
) {
|
||||
return Row(children: <Widget>[
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsUp),
|
||||
onTap: () => handleState(videoIntroController.actionLikeVideo),
|
||||
selectStatus: videoIntroController.hasLike.value,
|
||||
return Row(
|
||||
children: [
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.thumbsUp),
|
||||
onTap: () => handleState(videoIntroController.actionLikeVideo),
|
||||
selectStatus: videoIntroController.hasLike.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
text: !widget.loadingStatus
|
||||
? videoDetail.stat!.like!.toString()
|
||||
: '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.b),
|
||||
onTap: () => handleState(videoIntroController.actionCoinVideo),
|
||||
selectStatus: videoIntroController.hasCoin,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
text: !widget.loadingStatus
|
||||
? videoDetail.stat!.coin!.toString()
|
||||
: '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.heart),
|
||||
onTap: () => videoIntroController.showFavBottomSheet(context),
|
||||
onLongPress: () => videoIntroController.showFavBottomSheet(context,
|
||||
type: 'longPress'),
|
||||
selectStatus: videoIntroController.hasFav.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
text: !widget.loadingStatus
|
||||
? videoDetail.stat!.favorite!.toString()
|
||||
: '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.comment),
|
||||
onTap: () {
|
||||
videoDetailCtr.tabCtr.animateTo(1);
|
||||
},
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
text:
|
||||
!widget.loadingStatus ? videoDetail.stat!.like!.toString() : '-',
|
||||
!widget.loadingStatus ? videoDetail.stat!.reply!.toString() : '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.b),
|
||||
onTap: () => handleState(videoIntroController.actionCoinVideo),
|
||||
selectStatus: videoIntroController.hasCoin,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
text:
|
||||
!widget.loadingStatus ? videoDetail.stat!.coin!.toString() : '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Obx(
|
||||
() => ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.heart),
|
||||
onTap: () => videoIntroController.showFavBottomSheet(context),
|
||||
onLongPress: () => videoIntroController.showFavBottomSheet(context,
|
||||
type: 'longPress'),
|
||||
selectStatus: videoIntroController.hasFav.value,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
text: !widget.loadingStatus
|
||||
? videoDetail.stat!.favorite!.toString()
|
||||
: '-',
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.comment),
|
||||
onTap: () {
|
||||
videoDetailCtr.tabCtr.animateTo(1);
|
||||
},
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
text: !widget.loadingStatus ? videoDetail.stat!.reply!.toString() : '-',
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
ActionRowItem(
|
||||
const SizedBox(width: 8),
|
||||
ActionRowItem(
|
||||
icon: const Icon(FontAwesomeIcons.share),
|
||||
onTap: () => videoIntroController.actionShareVideo(context),
|
||||
selectStatus: false,
|
||||
loadingStatus: widget.loadingStatus,
|
||||
// text: !loadingStatus
|
||||
// ? videoDetail.stat!.share!.toString()
|
||||
// : '-',
|
||||
text: '转发'),
|
||||
]);
|
||||
text: '转发',
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
InlineSpan buildContent(BuildContext context, VideoDetailData content) {
|
||||
@@ -1079,7 +1032,6 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
String matchStr = match[0]!;
|
||||
if (RegExp(r'^av\d+$', caseSensitive: false).hasMatch(matchStr)) {
|
||||
try {
|
||||
// validate
|
||||
int aid = int.parse(matchStr.substring(2));
|
||||
IdUtils.av2bv(aid);
|
||||
spanChildren.add(
|
||||
@@ -1099,7 +1051,6 @@ class _VideoInfoState extends State<VideoInfo> {
|
||||
} else if (RegExp(r'^bv[a-z\d]{10}$', caseSensitive: false)
|
||||
.hasMatch(matchStr)) {
|
||||
try {
|
||||
// validate
|
||||
IdUtils.bv2av(matchStr);
|
||||
spanChildren.add(
|
||||
TextSpan(
|
||||
|
||||
@@ -150,11 +150,9 @@ class ActionItemState extends State<ActionItem>
|
||||
onTapDown: (details) => _isThumbsUp ? _startLongPress() : null,
|
||||
onTapUp: (details) => _isThumbsUp ? _cancelLongPress() : null,
|
||||
onTapCancel: () => _isThumbsUp ? _cancelLongPress(true) : null,
|
||||
// borderRadius: StyleString.mdRadius,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
// const SizedBox(height: 2),
|
||||
Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
@@ -231,7 +229,6 @@ class _ArcPainter extends CustomPainter {
|
||||
);
|
||||
|
||||
const startAngle = -pi / 2;
|
||||
// const sweepAngle = -2 * pi;
|
||||
|
||||
canvas.drawArc(rect, startAngle, sweepAngle, false, paint);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,6 @@ class _FavPanelState extends State<FavPanel> {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 骨架屏
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
|
||||
@@ -152,7 +152,6 @@ class _GroupPanelState extends State<GroupPanel> {
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// 骨架屏
|
||||
return const Center(
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
|
||||
@@ -67,15 +67,14 @@ class _PagesPanelState extends State<PagesPanel> {
|
||||
if (!_scrollController.hasClients || pages.isEmpty) {
|
||||
return;
|
||||
}
|
||||
const double itemWidth = 150; // 每个列表项的宽度
|
||||
const double itemWidth = 150;
|
||||
final double targetOffset = (pageIndex * itemWidth - itemWidth / 2).clamp(
|
||||
_scrollController.position.minScrollExtent,
|
||||
_scrollController.position.maxScrollExtent);
|
||||
// 滑动至目标位置
|
||||
_scrollController.animateTo(
|
||||
targetOffset,
|
||||
duration: const Duration(milliseconds: 300), // 滑动动画持续时间
|
||||
curve: Curves.easeInOut, // 滑动动画曲线
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,9 +61,6 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
}
|
||||
|
||||
/// 取对应 season_id 的 episodes
|
||||
// episodes = widget.ugcSeason.sections!
|
||||
// .firstWhere((e) => e.seasonId == widget.ugcSeason.id)
|
||||
// .episodes;
|
||||
currentIndex.value = episodes.indexWhere(
|
||||
(EpisodeItem e) => e.cid == _videoDetailController.seasonCid);
|
||||
_listener = _videoDetailController.cid.listen((int cid) {
|
||||
@@ -86,17 +83,6 @@ class _SeasonPanelState extends State<SeasonPanel> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
// void changeFucCall(item, int i) async {
|
||||
// await widget.changeFuc!(
|
||||
// IdUtils.av2bv(item.aid),
|
||||
// item.cid,
|
||||
// item.aid,
|
||||
// );
|
||||
// currentIndex = i;
|
||||
// Get.back();
|
||||
// setState(() {});
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (episodes.isEmpty) {
|
||||
|
||||
Reference in New Issue
Block a user