countUnread method

Future<int> countUnread(
  1. UserNotificationFilter filter
)

Counts unread notifications based on the provided filter.

Parameters:

Returns:

  • A Future that resolves to the count of unread notifications.

Implementation

Future<int> countUnread(UserNotificationFilter filter) async {
  return dio
      .post(
        "/count-unread",
        data: filter.toJSON(),
      )
      .then(
        (response) => (response.data as num).toInt(),
      );
}