import 'dart:io'; import 'package:eatvio_app/features/chat/models/chat_messages_model.dart'; import 'package:eatvio_app/features/chat/models/chat_room_model.dart'; import 'package:eatvio_app/features/chat/models/websocket_info_model.dart'; import 'package:eatvio_app/features/chat/services/chat_service.dart'; class ChatRepository { final ChatService chatService; ChatRepository({ required this.chatService, }); Future sendMessage({ required String chatId, String? data, List? filesList, }) async { try { await chatService.sendMessage( id: chatId, data: data, filesList: filesList, ); } catch (e) { print(e); rethrow; } } Future getChatRoom(String chatId) async { try { return (await chatService.getChatRoom(id: chatId))['chatRoom']!; } catch (e) { print(e); rethrow; } } Future getChatMessages(String chatId, int page) async { try { return (await chatService.getChatMessages(id: chatId, page: page)); } catch (e) { print(e); rethrow; } } Future getWebsocket() async { try { return (await chatService.getWebsocket()); } catch (e) { print(e); rethrow; } } }