mod: show count of reply2reply

This commit is contained in:
bggRGjQaUbCoE
2024-09-07 17:48:40 +08:00
parent 72a59384b9
commit cc56705714
5 changed files with 11 additions and 5 deletions

View File

@@ -31,6 +31,7 @@ class ReplyItemModel {
this.isUp,
this.isTop,
this.cardLabel,
this.rcount,
});
int? rpid;
@@ -61,6 +62,7 @@ class ReplyItemModel {
bool? isUp;
bool? isTop = false;
List? cardLabel;
dynamic rcount;
ReplyItemModel.fromJson(Map<String, dynamic> json, upperMid,
{isTopStatus = false}) {
@@ -99,6 +101,7 @@ class ReplyItemModel {
cardLabel = json['card_label'] != null
? json['card_label'].map((e) => e['text_content']).toList()
: [];
rcount = json['rcount'];
}
}

View File

@@ -117,7 +117,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
titleSpacing: 0,
centerTitle: false,
title: Text(
'评论详情',
'评论详情${replyItem.rcount > 0 ? '${replyItem.rcount}' : ''}',
style: Theme.of(context).textTheme.titleMedium,
),
),
@@ -425,7 +425,7 @@ class _DynamicDetailPageState extends State<DynamicDetailPage>
_dynamicDetailController.replyList[index],
showReplyRow: true,
replyLevel: '1',
replyReply: (replyItem) => replyReply(replyItem),
replyReply: replyReply,
replyType: ReplyType.values[replyType],
addReply: (replyItem) {
_dynamicDetailController

View File

@@ -153,13 +153,14 @@ class VideoDetailController extends GetxController
oid.value = IdUtils.bv2av(Get.parameters['bvid']!);
}
showReplyReplyPanel() {
showReplyReplyPanel(dynamic rcount) {
replyReplyBottomSheetCtr =
scaffoldKey.currentState?.showBottomSheet((BuildContext context) {
// SmartDialog.show(
// alignment: Alignment.bottomRight,
// builder: (context) {
return VideoReplyReplyPanel(
rcount: rcount,
oid: oid.value,
rpid: fRpid,
closePanel: () => {

View File

@@ -127,7 +127,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
videoDetailCtr.oid.value = replyItem.oid;
videoDetailCtr.fRpid = replyItem.rpid!;
videoDetailCtr.firstFloor = replyItem;
videoDetailCtr.showReplyReplyPanel();
videoDetailCtr.showReplyReplyPanel(replyItem.rcount);
}
}

View File

@@ -14,6 +14,7 @@ import 'controller.dart';
class VideoReplyReplyPanel extends StatefulWidget {
const VideoReplyReplyPanel({
this.rcount,
this.oid,
this.rpid,
this.closePanel,
@@ -22,6 +23,7 @@ class VideoReplyReplyPanel extends StatefulWidget {
this.replyType,
super.key,
});
final dynamic rcount;
final int? oid;
final int? rpid;
final Function? closePanel;
@@ -88,7 +90,7 @@ class _VideoReplyReplyPanelState extends State<VideoReplyReplyPanel> {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
const Text('评论详情'),
Text('评论详情${widget.rcount > 0 ? '${widget.rcount}' : ''}'),
IconButton(
tooltip: '关闭',
icon: const Icon(Icons.close, size: 20),