import '../../models/notification_model.dart'; import '../interfaces/notification_service.dart'; import 'api_client.dart'; class NotificationApiService implements NotificationService { final ApiClient _client; NotificationApiService(this._client); @override Future getNotifications() async { final List data = await _client.get('/admin/notifications'); return data .map((json) => NotificationModel.fromJson(json as Map)) .toList(); } @override Future sendPublicNotification(String title, String description) async { final encodedTitle = Uri.encodeQueryComponent(title); final encodedDesc = Uri.encodeQueryComponent(description); await _client.post( '/notifications/public?title=$encodedTitle&description=$encodedDesc', {}, ); } }