getNotifications method

Future<Either<BaseException, List<NotificationModel>>> getNotifications(
  1. NotificationsFilterModel? filter,
  2. PaginationModel pagination
)

Implementation

Future<Either<BaseException, List<NotificationModel>>> getNotifications(
  NotificationsFilterModel? filter,
  PaginationModel pagination,
) {
  return batch(
    NotificationsUrls.getList,
    queryParameters: filter?.toMap(),
    pagination: pagination,
    mapper: (json) => List<NotificationModel>.from(
      (json[ApiClient.batchKey] ?? []).map((e) => NotificationModel.fromMap(e)),
    ),
  );
}