Chat.fromMap constructor

Chat.fromMap(
  1. Map<String, dynamic> map
)

Creates a Chat instance from a Firestore document map.

Implementation

factory Chat.fromMap(Map<String, dynamic> map) {
  return Chat(
    chatId: map['chatId'],
    customerId: map['customerId'],
    nutritionistId: map['nutritionistId'],
    lastMessage: map['lastMessage'],
    lastMessageTime: DateTime.parse(map['lastMessageTime']),
  );
}