updateChat method
- ChatModel chat
Implementation
Future<void> updateChat(ChatModel chat) {
var index = _chats.indexWhere((element) => element.id == chat.id);
_chats[index] = chat;
_chatsController.addStream(Stream.value(_chats));
notifyListeners();
debugPrint('Chat updated: $chat');
return Future.value();
}