opt: 评论框优化

This commit is contained in:
guozhigq
2024-04-26 23:46:54 +08:00
parent 4e66a3f9e7
commit 8273ff2e02
6 changed files with 88 additions and 71 deletions

View File

@ -37,6 +37,7 @@ class VideoReplyController extends GetxController {
RxString sortTypeLabel = ReplySortType.time.labels.obs;
Box setting = GStrorage.setting;
RxInt replyReqCode = 200.obs;
@override
void onInit() {
@ -106,6 +107,7 @@ class VideoReplyController extends GetxController {
replyList.addAll(replies);
}
}
replyReqCode.value = res['code'];
isLoadingMore = false;
return res;
}

View File

@ -277,32 +277,39 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
parent: fabAnimationCtr,
curve: Curves.easeInOut,
)),
child: FloatingActionButton(
heroTag: null,
onPressed: () {
feedBack();
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return VideoReplyNewDialog(
oid: _videoReplyController.aid ??
IdUtils.bv2av(Get.parameters['bvid']!),
root: 0,
parent: 0,
replyType: ReplyType.video,
);
},
).then(
(value) => {
// 完成评论,数据添加
if (value != null && value['data'] != null)
{_videoReplyController.replyList.add(value['data'])}
},
);
},
tooltip: '发表评论',
child: const Icon(Icons.reply),
child: Obx(
() => _videoReplyController.replyReqCode.value == 12061
? const SizedBox()
: FloatingActionButton(
heroTag: null,
onPressed: () {
feedBack();
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return VideoReplyNewDialog(
oid: _videoReplyController.aid ??
IdUtils.bv2av(Get.parameters['bvid']!),
root: 0,
parent: 0,
replyType: ReplyType.video,
);
},
).then(
(value) => {
// 完成评论,数据添加
if (value != null && value['data'] != null)
{
_videoReplyController.replyList
.add(value['data'])
}
},
);
},
tooltip: '发表评论',
child: const Icon(Icons.reply),
),
),
),
),