// notification_service.dart import 'package:tm_app/core/utils/result.dart'; import 'package:tm_app/data/services/api/notification_api.dart'; import 'package:tm_app/data/services/model/notification__response/notification_response_model.dart'; import '../../core/network/network_manager.dart'; class NotificationsService { NotificationsService({required NetworkManager networkManager}) : _networkManager = networkManager; final NetworkManager _networkManager; Future> getNotifications({ required int limit, required int offset, }) async { final result = await _networkManager.makeRequest( NotificationApi.getNotifications(limit: limit, offset: offset), method: 'GET', (json) => NotificationResponseModel.fromJson(json), ); return result; } Future>> markAllAsRead() async { final result = await _networkManager.makeRequest( NotificationApi.markAllAsRead, method: 'GET', (json) => json, ); return result; } Future> markAsRead({ required String notificationId, }) async { final result = await _networkManager.makeRequest( '${NotificationApi.markAsRead}/$notificationId', method: 'GET', (json) => NotificationResponseModel.fromJson(json), ); return result; } Future> getUnreadNotifications({ required int limit, required int offset, }) async { final result = await _networkManager.makeRequest( NotificationApi.getUnreadNotifications(limit: limit, offset: offset), method: 'GET', (json) => NotificationResponseModel.fromJson(json), ); return result; } Future> getImportantNotifications({ required int limit, required int offset, }) async { final result = await _networkManager.makeRequest( NotificationApi.getImportantNotifications(limit: limit, offset: offset), method: 'GET', (json) => NotificationResponseModel.fromJson(json), ); return result; } }