mod: 动态评论、二级评论展示

This commit is contained in:
guozhigq
2023-07-23 17:26:50 +08:00
parent 8fe0215fbc
commit bcc6431ec5
9 changed files with 117 additions and 131 deletions

View File

@ -12,16 +12,16 @@ import 'package:pilipala/utils/storage.dart';
class VideoReplyNewDialog extends StatefulWidget {
int? oid;
int? root;
String? replyLevel;
int? parent;
ReplyType? replyType;
ReplyItemModel? replyItem;
VideoReplyNewDialog({
this.oid,
this.root,
this.replyLevel,
this.parent,
this.replyType,
this.replyItem,
});
@override
@ -36,14 +36,12 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
double _keyboardHeight = 0.0; // 键盘高度
final _debouncer = Debouncer(milliseconds: 100); // 设置延迟时间
bool ableClean = false;
bool autoFocus = false;
Timer? timer;
Box localCache = GStrorage.localCache;
late double sheetHeight;
@override
void initState() {
// TODO: implement initState
super.initState();
// 监听输入框聚焦
// replyContentFocusNode.addListener(_onFocus);
@ -74,14 +72,18 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
oid: widget.oid!,
root: widget.root!,
parent: widget.parent!,
message: message,
message: widget.replyItem != null && widget.replyItem!.root != 0
? ' 回复 @${widget.replyItem!.member!.uname!} : $message'
: message,
);
if (result['status']) {
SmartDialog.showToast(result['data']['success_toast']);
Get.back(result: {
'data': ReplyItemModel.fromJson(result['data']['reply'], ''),
});
} else {}
} else {
SmartDialog.showToast(result['msg']);
}
}
@override
@ -103,6 +105,12 @@ class _VideoReplyNewDialogState extends State<VideoReplyNewDialog>
});
}
@override
void dispose() {
_replyContentController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(