countNotifications method
Implementation
Future<int> countNotifications({bool? read, bool? archived, List<String> tags = const [] }) async {
var response = (await _client.get<Map<String, dynamic>>(
'notifications/count',
queryParameters: {
'filters': jsonEncode([{
if (tags.isNotEmpty == true) 'tags': tags,
if (read != null) 'read': read,
if (archived != null) 'archived': archived
}])
}
)).data!;
return response['data'].first['count'];
}