Skip to content

Commit

Permalink
simple doc fix for search list controller (#2004)
Browse files Browse the repository at this point in the history
  • Loading branch information
deven98 authored Aug 20, 2024
1 parent 39327e1 commit f964016
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ Check the [`StreamMessageSearchListView` documentation](../02-stream_chat_flutte
Building a custom message search feature is a common task. Here is an example of how to use the `StreamMessageSearchListController` to build a simple search list with pagination.

First of all we should create an instance of the `StreamMessageSearchListController` and provide it with the `StreamChatClient` instance.
You can also add a `Filter`, a list of `SortOption`s and other pagination-related parameters.
We can then add a filter to only get the channels that the current user is a part of.
You can also add a list of `SortOption`s and other pagination-related parameters.

```dart
class SearchListPageState extends State<SearchListPage> {
/// Controller used for loading more data and controlling pagination in
/// [StreamMessageSearchListController].
late final messageSearchListController = StreamMessageSearchListController(
client: StreamChatCore.of(context).client,
filter: Filter.in_('members', [StreamChat.of(context).currentUser!.id]),
);
```

Expand Down

0 comments on commit f964016

Please sign in to comment.