-
Notifications
You must be signed in to change notification settings - Fork 379
Description
Please select which package this feature is related to
stream_chat_flutter
Which platforms would this feature impact?
iOS, Android, Web
Is your feature request related to a problem?
No response
Describe the solution that you'd like
No response
Describe alternatives that you have considered
final subscription = client.state.unreadChannelsStream.listen((event) { unreadCount.value = event; });
This stream returns unread counts for all channels, but we only want to listen to specific channels. In the main chat list, we already use a controller with filters. We need to apply similar filtering to the unread count stream so that we receive unread counts only for those specific channels.
final controller = StreamChannelListController( client: client, filter: Filter.or([ Filter.and([ Filter.in_('members', [currentUser!.id]), Filter.notExists('event_type'), Filter.exists('last_message_at'), ]), Filter.and([ Filter.in_('members', [currentUser.id]), Filter.notExists('event_type'), Filter.equal('hidden', true), ]), ]), channelStateSort: const [SortOption('last_message_at')], limit: 20, );
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct