YIMMessage.fromJson constructor

YIMMessage.fromJson(
  1. Map<String, dynamic> map
)

Implementation

YIMMessage.fromJson(Map<String, dynamic> map) {
  id = map["id"]?.toString() ?? "";
  content = map["content"] == null ? null : Uri.decodeComponent(map["content"].toString());
  from = map["from"]?.toString() ?? "";
  to = map["to"]?.toString() ?? "";
  conversationType = YIMEnum_ConversationType.from(map["conversationType"].toString());
  messageType = YIMEnum_MessageType.from(map["messageType"].toString());
  messageState = YIMEnum_MessageState.from(map["messageState"].toString());
  time = DateTime.fromMillisecondsSinceEpoch(double.parse(map["time"]?.toString() ?? "0").toInt());
  localExt = map["localExt"];
  isRevoke = (map["isRevoke"]?.toString() ?? "0") == "1";
  attachment = map["attachment"] == null ? null : YIMAttachment.fromJson(map["attachment"] as Map<String, dynamic>);
}