This commit is contained in:
guozhigq
2024-08-11 18:43:21 +08:00
parent 66148cd1de
commit 1f9a65a5d2
2 changed files with 88 additions and 61 deletions

View File

@ -19,6 +19,7 @@ import 'package:pilipala/plugin/pl_gallery/index.dart';
import 'package:pilipala/plugin/pl_popup/index.dart';
import 'package:pilipala/utils/app_scheme.dart';
import 'package:pilipala/utils/feed_back.dart';
import 'package:pilipala/utils/id_utils.dart';
import 'package:pilipala/utils/storage.dart';
import 'package:pilipala/utils/url_utils.dart';
import 'package:pilipala/utils/utils.dart';
@ -35,6 +36,7 @@ class ReplyItem extends StatelessWidget {
this.showReplyRow = true,
this.replyReply,
this.replyType,
this.replySave = false,
super.key,
});
final ReplyItemModel? replyItem;
@ -43,6 +45,7 @@ class ReplyItem extends StatelessWidget {
final bool? showReplyRow;
final Function? replyReply;
final ReplyType? replyType;
final bool? replySave;
@override
Widget build(BuildContext context) {
@ -50,12 +53,18 @@ class ReplyItem extends StatelessWidget {
child: InkWell(
// 点击整个评论区 评论详情/回复
onTap: () {
if (replySave!) {
return;
}
feedBack();
if (replyReply != null) {
replyReply!(replyItem, null, replyItem!.replies!.isNotEmpty);
}
},
onLongPress: () {
if (replySave!) {
return;
}
feedBack();
showModalBottomSheet(
context: context,
@ -238,7 +247,7 @@ class ReplyItem extends StatelessWidget {
),
),
// 操作区域
bottonAction(context, replyItem!.replyControl),
bottonAction(context, replyItem!.replyControl, replySave),
// 一楼的评论
if ((replyItem!.replyControl!.isShow! ||
replyItem!.replies!.isNotEmpty) &&
@ -259,7 +268,7 @@ class ReplyItem extends StatelessWidget {
}
// 感谢、回复、复制
Widget bottonAction(BuildContext context, replyControl) {
Widget bottonAction(BuildContext context, replyControl, replySave) {
ColorScheme colorScheme = Theme.of(context).colorScheme;
TextTheme textTheme = Theme.of(context).textTheme;
return Row(
@ -292,6 +301,7 @@ class ReplyItem extends StatelessWidget {
});
},
child: Row(children: [
if (!replySave!) ...[
Icon(Icons.reply,
size: 18, color: colorScheme.outline.withOpacity(0.8)),
const SizedBox(width: 3),
@ -301,6 +311,15 @@ class ReplyItem extends StatelessWidget {
fontSize: textTheme.labelMedium!.fontSize,
color: colorScheme.outline,
),
)
],
if (replySave!)
Text(
IdUtils.av2bv(replyItem!.oid!),
style: TextStyle(
fontSize: textTheme.labelMedium!.fontSize,
color: colorScheme.outline,
),
),
]),
),
@ -1097,7 +1116,7 @@ class MorePanel extends StatelessWidget {
leading: const Icon(Icons.copy_outlined, size: 19),
title: Text('自由复制', style: textTheme.titleSmall),
),
if (mainFloor)
if (mainFloor && item.content.pictures.isEmpty)
ListTile(
onTap: () async => await menuActionHandler('save'),
minLeadingWidth: 0,

View File

@ -76,16 +76,21 @@ class _ReplySaveState extends State<ReplySave> {
@override
Widget build(BuildContext context) {
return Container(
return SafeArea(
top: false,
bottom: false,
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 4.0, sigmaY: 4.0),
child: Container(
width: Get.width,
height: Get.height,
margin: EdgeInsets.fromLTRB(
padding: EdgeInsets.fromLTRB(
0,
MediaQuery.of(context).padding.top + 4,
0,
MediaQuery.of(context).padding.bottom + 4,
),
color: Colors.transparent,
color: Colors.black54,
child: Column(
children: [
Expanded(
@ -104,6 +109,7 @@ class _ReplySaveState extends State<ReplySave> {
ReplyItem(
replyItem: widget.replyItem,
showReplyRow: false,
replySave: true,
),
Positioned.fill(
child: Column(
@ -135,6 +141,8 @@ class _ReplySaveState extends State<ReplySave> {
),
],
),
),
),
);
}
}