ChatMessage.fromJson constructor

ChatMessage.fromJson(
  1. Map<String, dynamic> json,
  2. String smsId
)

Implementation

factory ChatMessage.fromJson(Map<String, dynamic> json, String smsId) {
  return ChatMessage(
    id: smsId,
    text: json['text'],
    url: json['url'] ?? "",
    ownerId: json['ownerId'],
    ownerName: json['ownerName'],
    ownerProfile: json['ownerProfile'],
    createdOn: json['createdOn'].toDate(),
  );
}