From 23c6688e01c65e6dcc58a20fed27d6acee87b6e3 Mon Sep 17 00:00:00 2001 From: zdc Date: Wed, 15 Apr 2020 15:19:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E8=BF=87=E7=A8=8B=E4=B8=AD=E5=8F=96=E6=B6=88=E7=9A=84=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E4=BF=9D=E5=AD=98=E4=BA=BA=E5=B7=A5=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E4=B8=AD=E7=9A=84=E7=8A=B6=E6=80=81=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/chat/ChatPage.dart | 10 +- lib/chat/ChatPageItem.dart | 30 +---- lib/chat/group_chat_item.dart | 27 +--- lib/chat/group_chat_view.dart | 225 +++++++++++++++++--------------- lib/chat/input_bar.dart | 7 + lib/chat/msg_state_widge.dart | 32 ++++- lib/chat/upload_item.dart | 5 +- lib/data/chat_data_mgr.dart | 2 +- lib/utils/HttpUtil.dart | 2 +- lib/utils/chat_data_table.dart | 4 +- lib/utils/group_chat_table.dart | 2 +- lib/utils/sql_util.dart | 8 +- lib/utils/upload_util.dart | 24 +++- 13 files changed, 204 insertions(+), 174 deletions(-) diff --git a/lib/chat/ChatPage.dart b/lib/chat/ChatPage.dart index faef9eb..9ab2e28 100644 --- a/lib/chat/ChatPage.dart +++ b/lib/chat/ChatPage.dart @@ -715,7 +715,9 @@ class _ChatPageState extends State { return Container( padding: EdgeInsets.fromLTRB(10, 10, 10, 10), - decoration: BoxDecoration(color: Colors.white,border: Border(bottom: BorderSide(color: Colors.grey, width: .3))), + decoration: BoxDecoration( + color: Colors.white, + border: Border(bottom: BorderSide(color: Colors.grey, width: .3))), child: Row( children: [ ClipRRect( @@ -877,7 +879,11 @@ class _ChatPageState extends State { } _deleteItem(msg) { - MessageMgr().emit('Cancel Request', msg); + if (msg.state == MsgState.Uploading) { + print('取消上传'); + UploadUtil().cancelSendMsg(msg); + } + print('#### 开始删除--'); msgList.remove(msg); setState(() {}); diff --git a/lib/chat/ChatPageItem.dart b/lib/chat/ChatPageItem.dart index ab1b0d9..7ddc02d 100644 --- a/lib/chat/ChatPageItem.dart +++ b/lib/chat/ChatPageItem.dart @@ -13,6 +13,7 @@ import 'package:chat/chat/redbag_widget.dart'; import 'package:chat/chat/upload_item.dart'; import 'package:chat/chat/video_view.dart'; import 'package:chat/data/UserData.dart'; +import 'package:chat/data/chat_data_mgr.dart'; import 'package:chat/data/constants.dart'; import 'package:chat/generated/i18n.dart'; import 'package:chat/models/ChatMsg.dart'; @@ -31,6 +32,7 @@ import 'package:chat/utils/file_cache_mgr.dart'; import 'package:chat/utils/msgHandler.dart'; import 'package:chat/utils/screen.dart'; import 'package:chat/utils/sound_util.dart'; +import 'package:chat/utils/sql_util.dart'; import 'package:chat/utils/upload_util.dart'; import 'package:chat/utils/video_anim.dart'; import 'package:chat/utils/wpop/w_popup_menu.dart'; @@ -86,8 +88,6 @@ class _ChatPageItemState extends State String curSoundUrl; - CancelToken _cancelToken = CancelToken(); - bool isLongPressed = false; double maxWidth = Screen.width - 140; @@ -105,28 +105,14 @@ class _ChatPageItemState extends State textList = widget.msg.getTransTextList(); MessageMgr().on('Update Translate Message', updateTranslateMsg); - MessageMgr().on('Cancel Request', _deleteItem); - - MessageMgr().on('Cancel Request', _deleteItem); } @override void dispose() { - MessageMgr().off('Cancel Request', _deleteItem); MessageMgr().off('Update Translate Message', updateTranslateMsg); super.dispose(); } - _deleteItem(msg) { - if (msg == widget.msg) { - print(widget.msg.state); - if (widget.msg.state == MsgState.Uploading) { - print('取消上传'); - UploadUtil().cancelRequests(_cancelToken); - } - } - } - updateTextList() { textList.clear(); curTextType = 0; @@ -616,7 +602,6 @@ class _ChatPageItemState extends State child: ClipRRect( child: UploadImgItem( msg: widget.msg, - cancelToken: _cancelToken, child: Container( height: imgSize.height, width: imgSize.width, @@ -641,7 +626,6 @@ class _ChatPageItemState extends State children: [ UploadImgItem( msg: widget.msg, - cancelToken: _cancelToken, child: Container( width: imgSize.width, height: imgSize.height, @@ -702,7 +686,6 @@ class _ChatPageItemState extends State Widget _fileMsgItem() { return UploadImgItem( msg: widget.msg, - cancelToken: _cancelToken, child: Container( height: 100, constraints: BoxConstraints(maxWidth: Screen.width - 120), @@ -1083,7 +1066,8 @@ class _ChatPageItemState extends State print('请求人工翻译成功,进行扣费'); setState(() { widget.msg.transTag = 2; - + SqlUtil().updateUserTranslateState(widget.msg.sessionId, + widget.msg.time, widget.msg.transTag); //优先扣券 if (voucher > 0) { int costQuan = min(voucher, needMoney); @@ -1402,13 +1386,13 @@ class _ChatPageItemState extends State double width = 130; double minWidth = 0; - if (textList.length > 0 && textList[curTextType].length>0) { + if (textList.length > 0 && textList[curTextType].length > 0) { print('textList哒哒哒哒哒 ${textList[curTextType]}'); width = _getTextWidth(textList[curTextType]) + 20; width = min(width, Screen.width - 120); - if(width<130){ - width=130; + if (width < 130) { + width = 130; } showMsg.add(Padding( diff --git a/lib/chat/group_chat_item.dart b/lib/chat/group_chat_item.dart index 7548100..71f0e79 100644 --- a/lib/chat/group_chat_item.dart +++ b/lib/chat/group_chat_item.dart @@ -14,6 +14,7 @@ import 'package:chat/chat/video_view.dart'; import 'package:chat/data/UserData.dart'; import 'package:chat/data/constants.dart'; import 'package:chat/utils/friend_list_mgr.dart'; +import 'package:chat/utils/sql_util.dart'; import 'package:chat/utils/wpop/w_popup_menu.dart'; import 'package:flutter/services.dart'; import 'package:chat/generated/i18n.dart'; @@ -87,8 +88,6 @@ class _GroupChatPageItemState extends State String curSoundUrl; - CancelToken _cancelToken = CancelToken(); - bool isLongPressed = false; double maxWidth = Screen.width - 140; @@ -106,26 +105,14 @@ class _GroupChatPageItemState extends State textList = widget.msg.getTransTextList(); MessageMgr().on('Update Translate Message', updateTranslateMsg); - MessageMgr().on('Cancel Request', _deleteItem); } @override void dispose() { - MessageMgr().off('Cancel Request', _deleteItem); MessageMgr().off('Update Translate Message', updateTranslateMsg); super.dispose(); } - _deleteItem(msg) { - if (msg == widget.msg) { - print(widget.msg.state); - if (widget.msg.state == MsgState.Uploading) { - print('取消上传'); - UploadUtil().cancelRequests(_cancelToken); - } - } - } - updateTextList() { textList.clear(); curTextType = 0; @@ -578,7 +565,6 @@ class _GroupChatPageItemState extends State child: ClipRRect( child: UploadImgItem( msg: widget.msg, - cancelToken: _cancelToken, child: Container( height: imgSize.height, width: imgSize.width, @@ -603,7 +589,6 @@ class _GroupChatPageItemState extends State children: [ UploadImgItem( msg: widget.msg, - cancelToken: _cancelToken, child: Container( width: imgSize.width, height: imgSize.height, @@ -660,7 +645,6 @@ class _GroupChatPageItemState extends State Widget _fileMsgItem() { return UploadImgItem( msg: widget.msg, - cancelToken: _cancelToken, child: Container( height: 100, constraints: BoxConstraints(maxWidth: Screen.width - 120), @@ -1063,7 +1047,8 @@ class _GroupChatPageItemState extends State print('请求人工翻译成功,进行扣费'); setState(() { widget.msg.transTag = 2; - + SqlUtil().updateUserTranslateState(widget.msg.sessionId, + widget.msg.time, widget.msg.transTag); //优先扣券 if (voucher > 0) { int costQuan = min(voucher, needMoney); @@ -1367,13 +1352,13 @@ class _GroupChatPageItemState extends State double width = 130; double minWidth = 0; - if (textList.length > 0 && textList[curTextType].length>0) { + if (textList.length > 0 && textList[curTextType].length > 0) { width = _getTextWidth(textList[curTextType]) + 20; width = min(width, Screen.width - 120); minWidth = max(width, 150); - if(width<130){ - width=130; + if (width < 130) { + width = 130; } showMsg.add(Padding( diff --git a/lib/chat/group_chat_view.dart b/lib/chat/group_chat_view.dart index 41aec0e..de828cd 100644 --- a/lib/chat/group_chat_view.dart +++ b/lib/chat/group_chat_view.dart @@ -307,122 +307,127 @@ class _GroupChatPageState extends State { Provider.value(value: widget.groupInfoModel), ], child: GestureDetector( - onTap:hideKeyBoard, child: ExtendedTextSelectionPointerHandler( - ///选择文字,消除弹窗 - builder: (states) { - return Listener( - child: Scaffold( - resizeToAvoidBottomInset: false, - backgroundColor: const Color(0xFFE2E9F1), - appBar: AppBar( - backgroundColor: AppColors.NewAppbarBgColor, - title: Text( - widget.groupInfoModel.getGroupName(refMap), - textScaleFactor: 1.0, - style: TextStyle( - color: Constants.BlackTextColor, fontSize: 16.47), - ), - leading: CustomUI.buildCustomLeading(context), - titleSpacing: -10, - elevation: 1, - centerTitle: false, - actions: actions), - body: SafeArea( - child: Stack( - children: [ - Column( + onTap: hideKeyBoard, + child: ExtendedTextSelectionPointerHandler( + ///选择文字,消除弹窗 + builder: (states) { + return Listener( + child: Scaffold( + resizeToAvoidBottomInset: false, + backgroundColor: const Color(0xFFE2E9F1), + appBar: AppBar( + backgroundColor: AppColors.NewAppbarBgColor, + title: Text( + widget.groupInfoModel.getGroupName(refMap), + textScaleFactor: 1.0, + style: TextStyle( + color: Constants.BlackTextColor, + fontSize: 16.47), + ), + leading: CustomUI.buildCustomLeading(context), + titleSpacing: -10, + elevation: 1, + centerTitle: false, + actions: actions), + body: SafeArea( + child: Stack( children: [ - NetStateWidget(), - Expanded(child: _buildMessageList()), - InputBar(sendMsg: sendMsg), - ], - ), - isHaveUnreadNews - ? Positioned( - top: 32.5, - right: 0, - child: InkWell( - onTap: () { - jumpToMsg( - isAlterYou ? alterTime : unreadTime); - clearUnreadNews(); - }, - child: Container( - alignment: Alignment.center, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Color(0x33000000), //阴影颜色 - blurRadius: 7, //阴影大小 - ) - ], - borderRadius: BorderRadius.only( - topLeft: Radius.circular(80), - bottomLeft: Radius.circular(80)), - color: Colors.white, - ), - constraints: BoxConstraints(minWidth: 120), - height: 39, - child: Row( - children: [ - SizedBox(width: 16.5), - Image.asset( - 'assets/images/up.png', - width: 12, + Column( + children: [ + NetStateWidget(), + Expanded(child: _buildMessageList()), + InputBar(sendMsg: sendMsg), + ], + ), + isHaveUnreadNews + ? Positioned( + top: 32.5, + right: 0, + child: InkWell( + onTap: () { + jumpToMsg(isAlterYou + ? alterTime + : unreadTime); + clearUnreadNews(); + }, + child: Container( + alignment: Alignment.center, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Color(0x33000000), //阴影颜色 + blurRadius: 7, //阴影大小 + ) + ], + borderRadius: BorderRadius.only( + topLeft: Radius.circular(80), + bottomLeft: Radius.circular(80)), + color: Colors.white, ), - SizedBox(width: 10), - Container( - child: Text( + constraints: + BoxConstraints(minWidth: 120), + height: 39, + child: Row( + children: [ + SizedBox(width: 16.5), + Image.asset( + 'assets/images/up.png', + width: 12, + ), + SizedBox(width: 10), + Container( + child: Text( + isAlterYou + ? '$alterUserName' + : I18n.of(context) + .new_msg + .replaceFirst( + '/s1', + unreadNums + .toString()), + style: TextStyle( + color: Color(0xFF3875E9)), + overflow: + TextOverflow.ellipsis, + ), + constraints: BoxConstraints( + maxWidth: isAlterYou + ? 60 + : Screen.width)), + Text( isAlterYou - ? '$alterUserName' - : I18n.of(context) - .new_msg - .replaceFirst( - '/s1', - unreadNums - .toString()), + ? '@${I18n.of(context).you}' + : '', style: TextStyle( color: Color(0xFF3875E9)), - overflow: TextOverflow.ellipsis, ), - constraints: BoxConstraints( - maxWidth: isAlterYou - ? 60 - : Screen.width)), - Text( - isAlterYou - ? '@${I18n.of(context).you}' - : '', - style: TextStyle( - color: Color(0xFF3875E9)), + SizedBox(width: 14), + ], ), - SizedBox(width: 14), - ], - ), - ))) - : Container() - ], - ))), - onPointerDown: (value) { - for (var state in states) { - if (!state.containsPosition(value.position)) { - //clear other selection - state.clearSelection(); - } - } - }, - onPointerMove: (value) { - //clear other selection - for (var state in states) { - if (!state.containsPosition(value.position)) { + ))) + : Container() + ], + ))), + onPointerDown: (value) { + for (var state in states) { + if (!state.containsPosition(value.position)) { + //clear other selection + state.clearSelection(); + } + } + }, + onPointerMove: (value) { //clear other selection - state.clearSelection(); - } - } + for (var state in states) { + if (!state.containsPosition(value.position)) { + //clear other selection + state.clearSelection(); + } + } + }, + ); }, - ); - }, - ))); + ))); } Widget _buildMessageList() { @@ -510,7 +515,11 @@ class _GroupChatPageState extends State { } _deleteItem(msg) { - MessageMgr().emit('Cancel Request', msg); + if (msg.state == MsgState.Uploading) { + print('取消上传'); + UploadUtil().cancelSendMsg(msg); + } + print('#### 开始删除--'); msgList.remove(msg); setState(() {}); diff --git a/lib/chat/input_bar.dart b/lib/chat/input_bar.dart index 68f5f1b..edd1918 100644 --- a/lib/chat/input_bar.dart +++ b/lib/chat/input_bar.dart @@ -902,6 +902,13 @@ class InputBarState extends State } _sendMessage(String messageText, [bool isGift = false]) { + + var testMsg = messageText.replaceAll(' ', ''); + if (testMsg.length <=0 ) { + showToast('不能发送空白消息'); + return; + } + bool isGroup = Provider.of(context); int friendId = 0; diff --git a/lib/chat/msg_state_widge.dart b/lib/chat/msg_state_widge.dart index 736d1c5..faa82d4 100644 --- a/lib/chat/msg_state_widge.dart +++ b/lib/chat/msg_state_widge.dart @@ -1,6 +1,8 @@ import 'package:chat/models/ChatMsg.dart'; +import 'package:chat/proto/chat.pbserver.dart'; import 'package:chat/utils/MessageMgr.dart'; import 'package:chat/utils/msgHandler.dart'; +import 'package:chat/utils/upload_util.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -81,11 +83,31 @@ class _MsgStateWidgetState extends State { } else if (sendState == MsgState.SendingSuccess) { return Container(width: 0, height: 0); } else { - return Align( - alignment: Alignment.center, - child: Padding( - padding: EdgeInsets.only(top: 5), - child: CupertinoActivityIndicator())); + if (widget.msg.msgType == ChatType.ShortVideoChatType.value) { + return Container( + child: IconButton( + iconSize: 22, + icon: Icon( + Icons.pause_circle_outline, + color: Colors.red, + ), + onPressed: () { + print('暂停发送'); + UploadUtil().cancelSendMsg(widget.msg); + setState(() { + sendState = MsgState.UploadFailed; + }); + MsgHandler.sendChatMsg(widget.msg); + }, + ), + ); + } else { + return Align( + alignment: Alignment.center, + child: Padding( + padding: EdgeInsets.only(top: 5), + child: CupertinoActivityIndicator())); + } } } } diff --git a/lib/chat/upload_item.dart b/lib/chat/upload_item.dart index 8f5cc12..9da7225 100644 --- a/lib/chat/upload_item.dart +++ b/lib/chat/upload_item.dart @@ -12,10 +12,9 @@ class UploadImgItem extends StatefulWidget { final MsgModel msg; final Widget child; final bool isShowProgress; - final CancelToken cancelToken; UploadImgItem( - {this.msg, this.child, this.isShowProgress = true, this.cancelToken}); + {this.msg, this.child, this.isShowProgress = true}); @override _UploadItemState createState() => _UploadItemState(); @@ -58,7 +57,7 @@ class _UploadItemState extends State { } widget.msg.state = MsgState.Uploading; - await UploadUtil().uploadFile(widget.msg, cancelToken: widget.cancelToken); + await UploadUtil().uploadFile(widget.msg); if (mounted) { this.setState(() {}); diff --git a/lib/data/chat_data_mgr.dart b/lib/data/chat_data_mgr.dart index 0000f3f..02b4fdd 100644 --- a/lib/data/chat_data_mgr.dart +++ b/lib/data/chat_data_mgr.dart @@ -135,7 +135,7 @@ class ChatDataMgr { } } - int maxLen = min(curIndex + 1, record.length); + int maxLen = min(curIndex + 4, record.length); for (var i = curIndex + 1; i < maxLen; i++) { var shortDesc = record[i].shortRecordForTranslator(); diff --git a/lib/utils/HttpUtil.dart b/lib/utils/HttpUtil.dart index 23292a4..79788db 100644 --- a/lib/utils/HttpUtil.dart +++ b/lib/utils/HttpUtil.dart @@ -1178,7 +1178,7 @@ class HttpUtil { callback(); } - SqlUtil().updateUserTranslateRate(msg.sessionId, msg.time, msg.transTag); + SqlUtil().updateUserTranslateState(msg.sessionId, msg.time, msg.transTag); return true; } diff --git a/lib/utils/chat_data_table.dart b/lib/utils/chat_data_table.dart index 198b5a1..5ef528b 100644 --- a/lib/utils/chat_data_table.dart +++ b/lib/utils/chat_data_table.dart @@ -169,8 +169,8 @@ class ChatDataTableModel { whereArgs: [curUserId, session, sendTime]); } - //更新人工翻译评价 - updateUserTranslateRate(int session, int sendTime, int tranState) async { + //更新人工翻译状态 + updateUserTranslateState(int session, int sendTime, int tranState) async { var curUserId = UserData().basicInfo.userId; sql.db.update(table, {'transTag': tranState}, diff --git a/lib/utils/group_chat_table.dart b/lib/utils/group_chat_table.dart index dab6bb5..278fbb7 100644 --- a/lib/utils/group_chat_table.dart +++ b/lib/utils/group_chat_table.dart @@ -172,7 +172,7 @@ class GroupChatTableModel { } //更新人工翻译评价 - updateUserTranslateRate(int session, int sendTime, int tranState) async { + updateUserTranslateState(int session, int sendTime, int tranState) async { var curUserId = UserData().basicInfo.userId; sql.db.update(table, {'transTag': tranState}, diff --git a/lib/utils/sql_util.dart b/lib/utils/sql_util.dart index 5203c80..9963edd 100644 --- a/lib/utils/sql_util.dart +++ b/lib/utils/sql_util.dart @@ -119,9 +119,11 @@ class SqlUtil { session, sendTime, transContent, tranState); } - //更新人工翻译评价 - updateUserTranslateRate(int session, int sendTime, int tranState) async { - chatDataTableModel.updateUserTranslateRate(session, sendTime, tranState); + + + //更新人工翻译状态 + updateUserTranslateState(int session, int sendTime, int tranState) async { + chatDataTableModel.updateUserTranslateState(session, sendTime, tranState); } //更新消息发送状态 diff --git a/lib/utils/upload_util.dart b/lib/utils/upload_util.dart index f6e2a7f..4bbe1ae 100644 --- a/lib/utils/upload_util.dart +++ b/lib/utils/upload_util.dart @@ -42,6 +42,9 @@ class UploadUtil { //进度流 Map> streamMap = {}; + //取消map + Map cancelMap = {}; + //缓存进度,方便快速显示 Map streamLastPercentMap = {}; @@ -104,6 +107,20 @@ class UploadUtil { return streamMap[fileId]; } + getCancelToken(String fileId) { + if (cancelMap[fileId] == null) { + cancelMap[fileId] = CancelToken(); + } + return cancelMap[fileId]; + } + + cancelSendMsg(MsgModel msgModel){ + var token = cancelMap[msgModel.extraFile]; + if (token != null) { + token.cancel('用户取消'); + } + } + Future uploadFile(MsgModel msg, {CancelToken cancelToken}) async { Response response; @@ -132,7 +149,7 @@ class UploadUtil { print('开始上传文件${msg.extraFile} url:${uploadUrl + 'uploadchatfile'}'); var streamController = getStream(msg.extraFile); - + var cancelToken = getCancelToken(msg.extraFile); response = await dio.post(uploadUrl + 'uploadchatfile', data: formData, onSendProgress: (int progress, int total) { streamController.sink.add(progress / total); @@ -141,6 +158,7 @@ class UploadUtil { streamController.close(); streamMap.remove(msg.extraFile); + cancelMap.remove(msg.extraFile); print('uploadFile response $response'); print('###msgContent ${msg.msgContent.length}'); @@ -199,10 +217,8 @@ class UploadUtil { Future downloadFile(MsgModel msg, {CancelToken cancelToken}) async { Response response; - - var fullUrl = getFullUrl(msg.extraFile, msg.sessionId, msg.channelType); - if(msg.extraFile.contains('http://')){ + if (msg.extraFile.contains('http://')) { fullUrl = msg.extraFile; } From 4360f1c0fbc67ea5757cff00881f9ac68d86cb55 Mon Sep 17 00:00:00 2001 From: zdc Date: Wed, 15 Apr 2020 18:02:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=97=A7=E7=9A=84?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E7=8A=B6=E6=80=81=E6=8C=89=E9=92=AE=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8A=E4=BC=A0=E7=8A=B6=E6=80=81=E6=98=BE?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/chat/ChatPage.dart | 2 +- lib/chat/msg_state_widge.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chat/ChatPage.dart b/lib/chat/ChatPage.dart index 9ab2e28..65e2574 100644 --- a/lib/chat/ChatPage.dart +++ b/lib/chat/ChatPage.dart @@ -385,7 +385,7 @@ class _ChatPageState extends State { ]), ], )); - actions.add(TranslateSateWidget(friendId: friendInfo.userId)); + //actions.add(TranslateSateWidget(friendId: friendInfo.userId)); actions.add(Container( margin: EdgeInsets.only(top: 1), child: myPop.PopupMenuButton( diff --git a/lib/chat/msg_state_widge.dart b/lib/chat/msg_state_widge.dart index faa82d4..d52e34e 100644 --- a/lib/chat/msg_state_widge.dart +++ b/lib/chat/msg_state_widge.dart @@ -83,7 +83,7 @@ class _MsgStateWidgetState extends State { } else if (sendState == MsgState.SendingSuccess) { return Container(width: 0, height: 0); } else { - if (widget.msg.msgType == ChatType.ShortVideoChatType.value) { + if (widget.msg.state == MsgState.Uploading) { return Container( child: IconButton( iconSize: 22,