ChatMessage.fromMap constructor
create ChatMessage from json and retreve it from api
Implementation
factory ChatMessage.fromMap(Map<String, dynamic> map) {
return ChatMessage(
text: map['text'],
imageUrl: map['imageUrl'],
imagePath: map['imagePath'],
audioUrl: map['audioUrl'],
audioPath: map['audioPath'],
isSender: map['isSender'],
createdAt: DateTime.parse(map['createdAt']),
);
}