ZegoInRoomMessage constructor

ZegoInRoomMessage({
  1. required ZegoUIKitUser user,
  2. required String message,
  3. required int timestamp,
  4. required int messageID,
  5. Map<String, String> attributes = const {},
})

Implementation

ZegoInRoomMessage({
  required this.user,
  required this.message,
  required this.timestamp,
  required this.messageID,
  this.attributes = const {},
}) {
  try {
    /// {'msg':'xxx', 'attrs':''}
    var jsonMap = jsonDecode(message);
    message = jsonMap[messageKey]!;
    attributes = Map.from(jsonMap[attributesKey]!);
  } catch (e) {
    attributes = {};
  }
}