2023-09-05 21:56:25 +08:00

35 lines
913 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 '';
}
var readCount = 0;
if (wkMsg.wkMsgExtra != null) {
readCount = wkMsg.wkMsgExtra!.readedCount;
}
return wkMsg.messageContent!.displayText();
// return "${wkMsg.messageContent!.displayText()} [是否需要回执:${wkMsg.setting.receipt}][已读数量:$readCount]";
}
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';
}
}