mirror of
https://github.com/WuKongIM/WuKongIMFlutterSDK
synced 2025-05-25 11:52:20 +00:00
30 lines
665 B
Dart
30 lines
665 B
Dart
import 'package:wukongimfluttersdk/entity/msg.dart';
|
|
import 'package:wukongimfluttersdk/type/const.dart';
|
|
|
|
import 'const.dart';
|
|
|
|
class UIMsg {
|
|
WKMsg wkMsg;
|
|
UIMsg(this.wkMsg);
|
|
|
|
String getShowContent() {
|
|
if (wkMsg.messageContent == null) {
|
|
return '';
|
|
}
|
|
return wkMsg.messageContent!.displayText();
|
|
}
|
|
|
|
String getShowTime() {
|
|
return CommonUtils.formatDateTime(wkMsg.timestamp);
|
|
}
|
|
|
|
String getStatusIV() {
|
|
if (wkMsg.status == WKSendMsgResult.sendLoading) {
|
|
return 'assets/loading.png';
|
|
} else if (wkMsg.status == WKSendMsgResult.sendSuccess) {
|
|
return 'assets/success.png';
|
|
}
|
|
return 'assets/error.png';
|
|
}
|
|
}
|