markNotificationAs method

Future<InboxNotification> markNotificationAs(
  1. String id,
  2. MarkNotificationAs status
)

Implementation

Future<Dot.InboxNotification> markNotificationAs(String id, MarkNotificationAs status) async {
  var response = (await _client.patch<Map<String, dynamic>>(
    'notifications/$id/${status.name}',
  )).data!;

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

  return Dot.InboxNotification.fromJson(response['data']);
}