toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  return {
    'chatID': chatID,
    'user': user.toJson(),
    'lastmessage': lastmessage?.value.toJson(),
    'messages': messages.value?.map((message) => message.toJson()).toList(),
    'chatType': chatType.name,
    'chatNotification': chatNotification.value,
    'calling': calling?.value ?? false,
  };
}