|
|
|
@ -17,7 +17,6 @@ import 'package:pull_to_refresh/pull_to_refresh.dart';
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import '../../retrofit/data/im_user.dart'; |
|
|
|
|
import '../../retrofit/data/page.dart'; |
|
|
|
|
import '../../utils/flutter_utils.dart'; |
|
|
|
|
import '../../view_widget/custom_image.dart'; |
|
|
|
|
import 'on_chat_message.dart'; |
|
|
|
@ -641,7 +640,7 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
|
|
|
|
|
children: [ |
|
|
|
|
Expanded( |
|
|
|
|
child: Text( |
|
|
|
|
(lastMessageMap[conversationId]?.content ?? "").contains(".png")?"[图片]":lastMessageMap[conversationId]?.content, |
|
|
|
|
messageContent(lastMessageMap[conversationId]), |
|
|
|
|
maxLines: 1, |
|
|
|
|
overflow: TextOverflow.ellipsis, |
|
|
|
|
style: TextStyle( |
|
|
|
@ -679,6 +678,26 @@ class _IMPage extends State<IMPage> implements OnChatMessage {
|
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String messageContent(Message message) { |
|
|
|
|
if (message.msgType == 1) { |
|
|
|
|
return message.content ?? ""; |
|
|
|
|
} else if (message.msgType == 2) { |
|
|
|
|
return "【图片】"; |
|
|
|
|
} else if (message.msgType == 3) { |
|
|
|
|
return "【语音】"; |
|
|
|
|
} else if (message.msgType == 4) { |
|
|
|
|
return "【视频】"; |
|
|
|
|
} else if (message.msgType == 5) { |
|
|
|
|
return "【红包】"; |
|
|
|
|
} else if (message.msgType == 6) { |
|
|
|
|
return "【转账】"; |
|
|
|
|
} else if (message.msgType == 7) { |
|
|
|
|
return "【位置】"; |
|
|
|
|
} else { |
|
|
|
|
return "【未知的消息类型】"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Widget messageItem(img, title, messageNum) { |
|
|
|
|
return Container( |
|
|
|
|
padding: EdgeInsets.only(top: 8.h, bottom: 8.h, left: 16.w, right: 15.w), |
|
|
|
|