getNotifications method
Implementation
Future<Dot.PaginatedResponse<InboxNotification>> getNotifications({
bool archived = false,
bool? read,
int page = 0,
int limit = 10,
List<String> tags = const [],
}) async {
var response = (await _client.get<Map<String, dynamic>>(
'notifications',
queryParameters: {
'offset': page * limit,
'limit': limit,
'archived': archived,
if (read != null) 'read': read,
if (tags.isNotEmpty == true) 'tags[]': tags,
}
)).data!;
return Dot.PaginatedResponse<Dot.InboxNotification>(
page: response['page'] ?? page,
totalCount: response['totalCount'] ?? 0,
pageSize: limit,
hasMore: response['hasMore'],
data: response['data'].map<InboxNotification>((var r) => InboxNotification.fromJson(r)).toList(),
);
}