fix: loadMore reply

This commit is contained in:
guozhigq
2024-10-27 00:45:20 +08:00
parent 3aca6cecc2
commit 7485400894
2 changed files with 6 additions and 9 deletions

View File

@ -11,6 +11,7 @@ class ReplyItemModel {
this.parent, this.parent,
this.dialog, this.dialog,
this.count, this.count,
this.rcount,
this.floor, this.floor,
this.state, this.state,
this.fansgrade, this.fansgrade,
@ -41,6 +42,7 @@ class ReplyItemModel {
int? parent; int? parent;
int? dialog; int? dialog;
int? count; int? count;
int? rcount;
int? floor; int? floor;
int? state; int? state;
int? fansgrade; int? fansgrade;
@ -72,6 +74,7 @@ class ReplyItemModel {
parent = json['parent']; parent = json['parent'];
dialog = json['dialog']; dialog = json['dialog'];
count = json['count']; count = json['count'];
rcount = json['rcount'] ?? 0;
floor = json['floor']; floor = json['floor'];
state = json['state']; state = json['state'];
fansgrade = json['fansgrade']; fansgrade = json['fansgrade'];

View File

@ -1,6 +1,5 @@
import 'dart:math'; import 'dart:math';
import 'package:appscheme/appscheme.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
@ -60,9 +59,7 @@ class ReplyItem extends StatelessWidget {
return; return;
} }
feedBack(); feedBack();
if (replyReply != null) { replyReply?.call(replyItem, null, replyItem!.rcount! > 0);
replyReply!(replyItem, null, replyItem!.replies!.isNotEmpty);
}
}, },
onLongPress: () { onLongPress: () {
if (replySave!) { if (replySave!) {
@ -289,9 +286,7 @@ class ReplyItem extends StatelessWidget {
// 操作区域 // 操作区域
bottonAction(context, replyItem!.replyControl, replySave), bottonAction(context, replyItem!.replyControl, replySave),
// 一楼的评论 // 一楼的评论
if ((replyItem!.replyControl!.isShow! || if ((replyItem!.rcount! > 0) && showReplyRow!) ...[
replyItem!.replies!.isNotEmpty) &&
showReplyRow!) ...[
Padding( Padding(
padding: const EdgeInsets.only(top: 5, bottom: 12), padding: const EdgeInsets.only(top: 5, bottom: 12),
child: ReplyItemRow( child: ReplyItemRow(
@ -408,8 +403,7 @@ class ReplyItemRow extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final bool isShow = replyControl!.isShow!; final int extraRow = replyItem!.rcount! > 0 ? 1 : 0;
final int extraRow = replyControl != null && isShow ? 1 : 0;
ColorScheme colorScheme = Theme.of(context).colorScheme; ColorScheme colorScheme = Theme.of(context).colorScheme;
TextTheme textTheme = Theme.of(context).textTheme; TextTheme textTheme = Theme.of(context).textTheme;