From 38f565d0358449bd1cffe2d4fac85ec119e0f1e1 Mon Sep 17 00:00:00 2001 From: datang Date: Wed, 6 Apr 2022 14:03:55 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A4=BE=E5=8C=BA/=E5=8A=A8=E6=80=81/=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E2=80=94=E2=80=94=E8=BE=93=E5=85=A5=E6=A1=86=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E4=B8=BA=E7=A9=BA=E6=97=B6=E4=B8=8D=E8=83=BD=E6=8F=90?= =?UTF-8?q?=E4=BA=A4;=20=E7=A4=BE=E5=8C=BA/=E6=88=91=E7=9A=84=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E2=80=94=E2=80=94=E5=9B=BE=E7=89=87=E5=B7=A6=E5=AF=B9?= =?UTF-8?q?=E9=BD=90;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../community_views/event_detail_page.dart | 29 +++++++++++-------- .../community_views/my_community_view.dart | 1 + 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/ui/community/community_views/event_detail_page.dart b/lib/ui/community/community_views/event_detail_page.dart index e96c9032..a70b9b06 100644 --- a/lib/ui/community/community_views/event_detail_page.dart +++ b/lib/ui/community/community_views/event_detail_page.dart @@ -605,21 +605,26 @@ class _EventDetailPageState extends State { minWidth: 120.w, height: 55.w, onPressed: () async { - var res = await NetUtil() - .post(SAASAPI.community.commentInsert, params: params); - if (res.success) { - _textEditingController.clear(); - if (_rootId == 0) { - _refreshController.callRefresh(); + if (_textEditingController.text.trim().isEmptyOrNull) { + BotToast.showText(text: '请填写内容'); + return; + }else{ + var res = await NetUtil() + .post(SAASAPI.community.commentInsert, params: params); + if (res.success) { + _textEditingController.clear(); + if (_rootId == 0) { + _refreshController.callRefresh(); + } else { + await updateComments(); + _focusNode.unfocus(); + } + setState(() {}); } else { - await updateComments(); - _focusNode.unfocus(); + BotToast.showText(text: res.msg); } - setState(() {}); - } else { - BotToast.showText(text: res.msg); + FocusScope.of(context).requestFocus(FocusNode()); } - FocusScope.of(context).requestFocus(FocusNode()); }, child: Text( '发布', diff --git a/lib/ui/community/community_views/my_community_view.dart b/lib/ui/community/community_views/my_community_view.dart index fc85cc52..ef635f79 100644 --- a/lib/ui/community/community_views/my_community_view.dart +++ b/lib/ui/community/community_views/my_community_view.dart @@ -224,6 +224,7 @@ class MyCommunityViewState extends State ), 50.wb, Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: 552.w,