markAllNotificationAs method

Future<void> markAllNotificationAs(
  1. MarkAllNotificationAs status, {
  2. List<String> tags = const [],
})

Implementation

Future<void> markAllNotificationAs(MarkAllNotificationAs status, {List<String> tags = const []}) async {
  await _client.post<Map<String, dynamic>>(
      'notifications/${status.value}',
      data: {
        if (tags.isNotEmpty == true) 'tags': tags,
      }
  );

  if (onUnreadChanged != null) {
    countNotifications(read: false).then((value) => onUnreadChanged!(value));
  }
}