countUnread method
Counts unread notifications based on the provided filter.
Parameters:
filter
: The UserNotificationFilter to filter the unread notifications.
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(),
);
}