setTypingStatus method

Future<void> setTypingStatus(
  1. String senderId,
  2. String receiverId,
  3. bool isTyping
)

Set the typing status for a user in a chat This updates the typing status in Firestore for the specified chat and user.

Implementation

Future<void> setTypingStatus(
    String senderId, String receiverId, bool isTyping) {
  final chatId = getChatId(senderId, receiverId);
  return _firestore.collection('chats').doc(chatId).update({
    'typingStatus.$senderId': isTyping,
  });
}