opt: reply item

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-04-07 10:09:34 +08:00
parent b14844f459
commit e073086cf4
8 changed files with 19 additions and 36 deletions

View File

@@ -19,7 +19,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:get/get.dart';
import 'package:PiliPlus/common/widgets/network_img_layer.dart';
import 'package:PiliPlus/models/common/reply_type.dart';
import 'package:PiliPlus/pages/video/detail/index.dart';
import 'package:PiliPlus/utils/feed_back.dart';
import 'package:PiliPlus/utils/storage.dart';
@@ -31,10 +30,8 @@ class ReplyItemGrpc extends StatelessWidget {
const ReplyItemGrpc({
super.key,
required this.replyItem,
this.replyLevel,
this.showReplyRow = true,
required this.replyLevel,
this.replyReply,
this.replyType,
this.needDivider = true,
this.onReply,
this.onDelete,
@@ -48,12 +45,10 @@ class ReplyItemGrpc extends StatelessWidget {
this.onToggleTop,
});
final ReplyInfo replyItem;
final String? replyLevel;
final bool showReplyRow;
final Function? replyReply;
final ReplyType? replyType;
final String replyLevel;
final Function(ReplyInfo replyItem, int? rpid)? replyReply;
final bool needDivider;
final Function()? onReply;
final VoidCallback? onReply;
final Function(dynamic rpid, dynamic frpid)? onDelete;
final dynamic upMid;
final VoidCallback? showDialogue;
@@ -406,7 +401,7 @@ class ReplyItemGrpc extends StatelessWidget {
// 操作区域
if (replyLevel != '') buttonAction(context, replyItem.replyControl),
// 一楼的评论
if (showReplyRow &&
if (replyLevel == '1' &&
( //replyItem.replyControl!.isShow! ||
replyItem.replies.isNotEmpty ||
replyItem.replyControl.subReplyEntryText.isNotEmpty)) ...[
@@ -505,7 +500,7 @@ class ReplyItemGrpc extends StatelessWidget {
),
),
const Spacer(),
ZanButtonGrpc(replyItem: replyItem, replyType: replyType),
ZanButtonGrpc(replyItem: replyItem),
const SizedBox(width: 5)
],
);

View File

@@ -194,7 +194,6 @@ class _ReplySavePanelState extends State<ReplySavePanel> {
IgnorePointer(
child: ReplyItemGrpc(
replyItem: widget.replyItem,
showReplyRow: false,
replyLevel: '',
needDivider: false,
upMid: widget.upMid,

View File

@@ -5,7 +5,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:PiliPlus/http/reply.dart';
import 'package:PiliPlus/models/common/reply_type.dart';
import 'package:PiliPlus/utils/feed_back.dart';
import 'package:fixnum/fixnum.dart' as $fixnum;
@@ -13,11 +12,9 @@ class ZanButtonGrpc extends StatefulWidget {
const ZanButtonGrpc({
super.key,
required this.replyItem,
this.replyType,
});
final ReplyInfo replyItem;
final ReplyType? replyType;
@override
State<ZanButtonGrpc> createState() => _ZanButtonGrpcState();
@@ -33,7 +30,7 @@ class _ZanButtonGrpcState extends State<ZanButtonGrpc> {
final int action =
widget.replyItem.replyControl.action.toInt() != 2 ? 2 : 0;
final res = await ReplyHttp.hateReply(
type: widget.replyType!.index,
type: widget.replyItem.type.toInt(),
action: action == 2 ? 1 : 0,
oid: oid,
rpid: rpid,
@@ -68,7 +65,7 @@ class _ZanButtonGrpcState extends State<ZanButtonGrpc> {
final int action =
widget.replyItem.replyControl.action.toInt() != 1 ? 1 : 0;
final res = await ReplyHttp.likeReply(
type: widget.replyType!.index,
type: widget.replyItem.type.toInt(),
oid: oid,
rpid: rpid,
action: action,