getChatById method

  1. @override
Future<ChatModel> getChatById(
  1. String id
)
override

Retrieves a chat based on the ID.

Implementation

@override
Future<ChatModel> getChatById(String id) {
  var chat = _chats.firstWhere((element) => element.id == id);
  debugPrint('Retrieved chat by ID: $chat');
  debugPrint('Messages are: ${chat.messages?.length}');
  return Future.value(chat);
}