import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_request_model.dart'; import 'package:diplomaticquarterapp/core/model/notifications/get_notifications_response_model.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart'; class NotificationService extends BaseService { List notificationsList = List(); Future getAllNotifications(GetNotificationsRequestModel getNotificationsRequestModel ) async { hasError = false; await baseAppClient.post(PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS, onSuccess: (dynamic response, int statusCode) { notificationsList.clear(); response['List_GetAllNotificationsFromPool'].forEach((appoint) { notificationsList.add(GetNotificationsResponseModel.fromJson(appoint)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: getNotificationsRequestModel.toJson()); } }