Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-15 16:41:49 +08:00
parent a3424950ca
commit 7c30668c87
2 changed files with 60 additions and 67 deletions

View File

@@ -438,6 +438,7 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
gapSize: 25, gapSize: 25,
itemCount: videoItem['staff'].length, itemCount: videoItem['staff'].length,
childBuilder: (index) => GestureDetector( childBuilder: (index) => GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
int? ownerMid = !widget.loadingStatus int? ownerMid = !widget.loadingStatus
? videoDetail.owner?.mid ? videoDetail.owner?.mid

View File

@@ -26,7 +26,7 @@ import 'package:html/parser.dart' show parse;
class ReplyItem extends StatelessWidget { class ReplyItem extends StatelessWidget {
const ReplyItem({ const ReplyItem({
super.key, super.key,
this.replyItem, required this.replyItem,
this.replyLevel, this.replyLevel,
this.showReplyRow = true, this.showReplyRow = true,
this.replyReply, this.replyReply,
@@ -39,7 +39,7 @@ class ReplyItem extends StatelessWidget {
this.getTag, this.getTag,
this.callback, this.callback,
}); });
final ReplyItemModel? replyItem; final ReplyItemModel replyItem;
final String? replyLevel; final String? replyLevel;
final bool? showReplyRow; final bool? showReplyRow;
final Function? replyReply; final Function? replyReply;
@@ -69,7 +69,7 @@ class ReplyItem extends StatelessWidget {
isScrollControlled: true, isScrollControlled: true,
builder: (context) { builder: (context) {
return MorePanel( return MorePanel(
item: replyItem!, item: replyItem,
onDelete: (rpid) { onDelete: (rpid) {
onDelete?.call(rpid, null); onDelete?.call(rpid, null);
}, },
@@ -80,7 +80,7 @@ class ReplyItem extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
if (ModuleAuthorModel.showDynDecorate && if (ModuleAuthorModel.showDynDecorate &&
(replyItem?.member?.userSailing?.cardbg?['image'] as String?) (replyItem.member?.userSailing?.cardbg?['image'] as String?)
?.isNotEmpty == ?.isNotEmpty ==
true) true)
Stack( Stack(
@@ -95,16 +95,16 @@ class ReplyItem extends StatelessWidget {
CachedNetworkImage( CachedNetworkImage(
height: 38, height: 38,
imageUrl: imageUrl:
replyItem?.member?.userSailing?.cardbg?['image'], replyItem.member?.userSailing?.cardbg?['image'],
), ),
if ((replyItem?.member?.userSailing?.cardbg?['fan'] if ((replyItem.member?.userSailing?.cardbg?['fan']
?['num_desc'] as String?) ?['num_desc'] as String?)
?.isNotEmpty == ?.isNotEmpty ==
true) true)
Text( Text(
'NO.\n${replyItem?.member?.userSailing?.cardbg?['fan']?['num_desc']}', 'NO.\n${replyItem.member?.userSailing?.cardbg?['fan']?['num_desc']}',
style: style:
(replyItem?.member?.userSailing?.cardbg?['fan'] (replyItem.member?.userSailing?.cardbg?['fan']
?['color'] as String?) ?['color'] as String?)
?.startsWith('#') == ?.startsWith('#') ==
true true
@@ -113,7 +113,7 @@ class ReplyItem extends StatelessWidget {
fontFamily: 'digital_id_num', fontFamily: 'digital_id_num',
color: Color( color: Color(
int.parse( int.parse(
replyItem?.member?.userSailing replyItem.member?.userSailing
?.cardbg?['fan']?['color'] ?.cardbg?['fan']?['color']
.replaceFirst('#', '0xFF'), .replaceFirst('#', '0xFF'),
), ),
@@ -152,11 +152,11 @@ class ReplyItem extends StatelessWidget {
clipBehavior: Clip.none, clipBehavior: Clip.none,
children: [ children: [
if (ModuleAuthorModel.showDynDecorate && if (ModuleAuthorModel.showDynDecorate &&
replyItem?.member?.pendant?.image?.isNotEmpty == true) ...[ replyItem.member?.pendant?.image?.isNotEmpty == true) ...[
Padding( Padding(
padding: const EdgeInsets.all(2), padding: const EdgeInsets.all(2),
child: NetworkImgLayer( child: NetworkImgLayer(
src: replyItem!.member!.avatar, src: replyItem.member?.avatar,
width: 30, width: 30,
height: 30, height: 30,
type: 'avatar', type: 'avatar',
@@ -169,18 +169,18 @@ class ReplyItem extends StatelessWidget {
child: CachedNetworkImage( child: CachedNetworkImage(
width: 52, width: 52,
height: 52, height: 52,
imageUrl: replyItem!.member!.pendant!.image!, imageUrl: replyItem.member!.pendant!.image!,
), ),
), ),
), ),
] else ] else
NetworkImgLayer( NetworkImgLayer(
src: replyItem!.member!.avatar, src: replyItem.member?.avatar,
width: 34, width: 34,
height: 34, height: 34,
type: 'avatar', type: 'avatar',
), ),
if (replyItem!.member!.vip!['vipStatus'] > 0) if ((replyItem.member?.vip?['vipStatus'] ?? -1) > 0)
Positioned( Positioned(
right: 0, right: 0,
bottom: 0, bottom: 0,
@@ -198,8 +198,7 @@ class ReplyItem extends StatelessWidget {
), ),
), ),
//https://www.bilibili.com/blackboard/activity-whPrHsYJ2.html //https://www.bilibili.com/blackboard/activity-whPrHsYJ2.html
if (replyItem!.member!.officialVerify != null && if (replyItem.member?.officialVerify?['type'] == 0)
replyItem!.member!.officialVerify!['type'] == 0)
Positioned( Positioned(
left: 0, left: 0,
bottom: 0, bottom: 0,
@@ -217,8 +216,7 @@ class ReplyItem extends StatelessWidget {
), ),
), ),
), ),
if (replyItem!.member!.officialVerify != null && if (replyItem.member?.officialVerify?['type'] == 1)
replyItem!.member!.officialVerify!['type'] == 1)
Positioned( Positioned(
left: 0, left: 0,
bottom: 0, bottom: 0,
@@ -241,7 +239,7 @@ class ReplyItem extends StatelessWidget {
} }
Widget content(BuildContext context) { Widget content(BuildContext context) {
if (replyItem?.member == null) return const SizedBox(); if (replyItem.member == null) return const SizedBox();
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@@ -251,7 +249,7 @@ class ReplyItem extends StatelessWidget {
behavior: HitTestBehavior.opaque, behavior: HitTestBehavior.opaque,
onTap: () { onTap: () {
feedBack(); feedBack();
Get.toNamed('/member?mid=${replyItem!.mid}'); Get.toNamed('/member?mid=${replyItem.mid}');
}, },
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@@ -266,10 +264,9 @@ class ReplyItem extends StatelessWidget {
Row( Row(
children: [ children: [
Text( Text(
replyItem!.member!.uname!, '${replyItem.member?.uname}',
style: TextStyle( style: TextStyle(
color: (replyItem!.member!.vip!['vipStatus'] > 0 && color: (replyItem.member?.vip?['vipType'] == 2)
replyItem!.member!.vip!['vipType'] == 2)
? context.vipColor ? context.vipColor
: Theme.of(context).colorScheme.outline, : Theme.of(context).colorScheme.outline,
fontSize: 13, fontSize: 13,
@@ -277,12 +274,11 @@ class ReplyItem extends StatelessWidget {
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
Image.asset( Image.asset(
'assets/images/lv/lv${replyItem!.member!.level}.png', 'assets/images/lv/lv${replyItem.member?.level}.png',
height: 11, height: 11,
semanticLabel: "等级:${replyItem!.member!.level}",
), ),
const SizedBox(width: 6), const SizedBox(width: 6),
if (replyItem!.isUp!) if (replyItem.isUp == true)
const PBadge( const PBadge(
text: 'UP', text: 'UP',
size: 'small', size: 'small',
@@ -295,17 +291,16 @@ class ReplyItem extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: <Widget>[ children: <Widget>[
Text( Text(
Utils.dateFormat(replyItem!.ctime), Utils.dateFormat(replyItem.ctime),
style: TextStyle( style: TextStyle(
fontSize: fontSize:
Theme.of(context).textTheme.labelSmall!.fontSize, Theme.of(context).textTheme.labelSmall!.fontSize,
color: Theme.of(context).colorScheme.outline, color: Theme.of(context).colorScheme.outline,
), ),
), ),
if (replyItem!.replyControl != null && if (replyItem.replyControl?.location?.isNotEmpty == true)
replyItem!.replyControl!.location != '')
Text( Text(
'${replyItem!.replyControl!.location!}', '${replyItem.replyControl!.location!}',
style: TextStyle( style: TextStyle(
fontSize: Theme.of(context) fontSize: Theme.of(context)
.textTheme .textTheme
@@ -326,7 +321,7 @@ class ReplyItem extends StatelessWidget {
const EdgeInsets.only(top: 10, left: 45, right: 6, bottom: 4), const EdgeInsets.only(top: 10, left: 45, right: 6, bottom: 4),
child: LayoutBuilder( child: LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) { builder: (BuildContext context, BoxConstraints constraints) {
String text = replyItem?.content?.message ?? ''; String text = replyItem.content?.message ?? '';
TextStyle style = TextStyle( TextStyle style = TextStyle(
height: 1.75, height: 1.75,
fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize, fontSize: Theme.of(context).textTheme.bodyMedium!.fontSize,
@@ -347,7 +342,7 @@ class ReplyItem extends StatelessWidget {
style: style, style: style,
TextSpan( TextSpan(
children: [ children: [
if (replyItem!.isTop!) ...[ if (replyItem.isTop == true) ...[
const WidgetSpan( const WidgetSpan(
alignment: PlaceholderAlignment.top, alignment: PlaceholderAlignment.top,
child: PBadge( child: PBadge(
@@ -364,7 +359,7 @@ class ReplyItem extends StatelessWidget {
], ],
buildContent( buildContent(
context, context,
replyItem!, replyItem,
replyReply, replyReply,
null, null,
textPainter, textPainter,
@@ -378,27 +373,26 @@ class ReplyItem extends StatelessWidget {
), ),
), ),
// 操作区域 // 操作区域
buttonAction(context, replyItem!.replyControl), buttonAction(context, replyItem.replyControl),
// 一楼的评论 // 一楼的评论
if ((replyItem!.replyControl!.isShow! || if (showReplyRow == true &&
replyItem!.replies!.isNotEmpty || (replyItem.replyControl?.isShow == true ||
replyItem!.replyControl!.entryText != null) && replyItem.replies?.isNotEmpty == true ||
showReplyRow!) ...[ replyItem.replyControl?.entryText?.isNotEmpty == true))
Padding( Padding(
padding: const EdgeInsets.only(top: 5, bottom: 12), padding: const EdgeInsets.only(top: 5, bottom: 12),
child: replyItemRow( child: replyItemRow(
context: context, context: context,
replies: replyItem!.replies, replies: replyItem.replies,
replyControl: replyItem!.replyControl, replyControl: replyItem.replyControl,
// f_rpid: replyItem!.rpid, // f_rpid: replyItem.rpid,
replyItem: replyItem, replyItem: replyItem,
replyReply: replyReply, replyReply: replyReply,
onDelete: (rpid) { onDelete: (rpid) {
onDelete?.call(rpid, replyItem!.rpid); onDelete?.call(rpid, replyItem.rpid);
}, },
), ),
), ),
],
], ],
); );
} }
@@ -433,7 +427,7 @@ class ReplyItem extends StatelessWidget {
), ),
), ),
const SizedBox(width: 2), const SizedBox(width: 2),
if (replyItem!.upAction!.like!) ...[ if (replyItem.upAction?.like == true) ...[
SizedBox( SizedBox(
height: 32, height: 32,
child: TextButton( child: TextButton(
@@ -450,8 +444,7 @@ class ReplyItem extends StatelessWidget {
), ),
const SizedBox(width: 2), const SizedBox(width: 2),
], ],
if (replyItem!.cardLabel!.isNotEmpty && if (replyItem.cardLabel?.contains('热评') == true)
replyItem!.cardLabel!.contains('热评'))
Text( Text(
'热评', '热评',
style: TextStyle( style: TextStyle(
@@ -467,16 +460,15 @@ class ReplyItem extends StatelessWidget {
Widget replyItemRow({ Widget replyItemRow({
context, context,
replies, List<ReplyItemModel>? replies,
replyControl, ReplyControl? replyControl,
replyItem, required ReplyItemModel replyItem,
replyReply, replyReply,
onDelete, onDelete,
}) { }) {
final int extraRow = replyControl?.isShow == true || final bool hasExtraRow = replyControl?.isShow == true ||
(replyControl?.entryText != null && replies!.isEmpty) (replyControl?.entryText?.isNotEmpty == true &&
? 1 replies?.isEmpty == true);
: 0;
return Container( return Container(
margin: const EdgeInsets.only(left: 42, right: 4, top: 0), margin: const EdgeInsets.only(left: 42, right: 4, top: 0),
child: Material( child: Material(
@@ -487,7 +479,7 @@ class ReplyItem extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
if (replies!.isNotEmpty) if (replies?.isNotEmpty == true)
for (int i = 0; i < replies!.length; i++) ...[ for (int i = 0; i < replies!.length; i++) ...[
InkWell( InkWell(
// 一楼点击评论展开评论详情 // 一楼点击评论展开评论详情
@@ -500,7 +492,7 @@ class ReplyItem extends StatelessWidget {
isScrollControlled: true, isScrollControlled: true,
builder: (context) { builder: (context) {
return MorePanel( return MorePanel(
item: replies![i], item: replies[i],
onDelete: onDelete, onDelete: onDelete,
); );
}, },
@@ -510,13 +502,13 @@ class ReplyItem extends StatelessWidget {
width: double.infinity, width: double.infinity,
padding: EdgeInsets.fromLTRB( padding: EdgeInsets.fromLTRB(
8, 8,
i == 0 && (extraRow == 1 || replies!.length > 1) ? 8 : 4, i == 0 && (hasExtraRow || replies.length > 1) ? 8 : 4,
8, 8,
i == 0 && (extraRow == 1 || replies!.length > 1) ? 4 : 6, i == 0 && (hasExtraRow || replies.length > 1) ? 4 : 6,
), ),
child: Semantics( child: Semantics(
label: label:
'${replies![i].member!.uname} ${replies![i].content!.message}', '${replies[i].member?.uname} ${replies[i].content?.message}',
excludeSemantics: true, excludeSemantics: true,
child: Text.rich( child: Text.rich(
style: TextStyle( style: TextStyle(
@@ -534,7 +526,7 @@ class ReplyItem extends StatelessWidget {
TextSpan( TextSpan(
children: [ children: [
TextSpan( TextSpan(
text: '${replies![i].member!.uname}', text: '${replies[i].member?.uname}',
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),
@@ -542,10 +534,10 @@ class ReplyItem extends StatelessWidget {
..onTap = () { ..onTap = () {
feedBack(); feedBack();
Get.toNamed( Get.toNamed(
'/member?mid=${replies![i].member!.mid}'); '/member?mid=${replies[i].member?.mid}');
}, },
), ),
if (replies![i].isUp!) ...[ if (replies[i].isUp == true) ...[
const TextSpan(text: ' '), const TextSpan(text: ' '),
const WidgetSpan( const WidgetSpan(
alignment: PlaceholderAlignment.middle, alignment: PlaceholderAlignment.middle,
@@ -560,14 +552,14 @@ class ReplyItem extends StatelessWidget {
const TextSpan(text: ' '), const TextSpan(text: ' '),
], ],
TextSpan( TextSpan(
text: replies![i].root == replies![i].parent text: replies[i].root == replies[i].parent
? ': ' ? ': '
: replies![i].isUp! : replies[i].isUp == true
? '' ? ''
: ' '), : ' '),
buildContent( buildContent(
context, context,
replies![i], replies[i],
replyReply, replyReply,
replyItem, replyItem,
null, null,
@@ -580,7 +572,7 @@ class ReplyItem extends StatelessWidget {
), ),
) )
], ],
if (extraRow == 1) if (hasExtraRow)
InkWell( InkWell(
// 一楼点击【共xx条回复】展开评论详情 // 一楼点击【共xx条回复】展开评论详情
onTap: () => replyReply?.call(replyItem, null, null), onTap: () => replyReply?.call(replyItem, null, null),
@@ -594,7 +586,7 @@ class ReplyItem extends StatelessWidget {
Theme.of(context).textTheme.labelMedium!.fontSize, Theme.of(context).textTheme.labelMedium!.fontSize,
), ),
children: [ children: [
if (replyControl!.upReply!) if (replyControl?.upReply == true)
TextSpan( TextSpan(
text: 'UP主等人 ', text: 'UP主等人 ',
style: TextStyle( style: TextStyle(
@@ -604,7 +596,7 @@ class ReplyItem extends StatelessWidget {
.withOpacity(0.85), .withOpacity(0.85),
)), )),
TextSpan( TextSpan(
text: replyControl!.entryText!, text: replyControl?.entryText,
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.primary, color: Theme.of(context).colorScheme.primary,
), ),