getNotifications method
Implementation
Future<List<UserNotificationVO>> getNotifications({
int limit = 50,
DocumentSnapshot? startAt,
String? orderBy,
bool descending = false,
required String userId,
}) async {
try {
final models = await _userNotificationsDataService.getNotifications(
limit: limit,
startAt: startAt,
userId: userId,
orderBy: orderBy,
descending: descending,
);
final vos = models.map((e) {
final vo = UserNotificationVO.fromModel(e);
return vo;
}).toList();
return vos;
} catch (e) {
if (e is RdevException) {
throw UserNotificationsServiceException(
code: e.code, message: e.message, stackTrace: e.stackTrace);
}
throw UserNotificationsServiceException(message: e.toString());
}
}