You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
diplomatic-quarter/lib/core/service/notifications_service.dart

23 lines
1.1 KiB
Dart

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<GetNotificationsResponseModel> 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());
}
}