/ SDKs / Flutter
SDKs
Chat SDKs Flutter v4
Chat SDKs Flutter
Chat SDKs
Flutter
Version 4

Search open channels by name, URL, or custom type

Copy link

You can search for specific open channels by adding keywords to an OpenChannelListQuery instance. There are two types of keywords that can be used: name and URL.

The code sample below shows the query instance which returns a list of open channels that partially match the specified nameKeyword keyword in their channel names.

try {
  final query = OpenChannelListQuery()
    ..nameKeyword = 'Sendbird';

  final openChannels = await query.next();
} catch (e) {
  // Handle error.
}

The following shows the query instance which returns a list of open channels that partially match the specified urlKeyword keyword in their channel URLs.

try {
  final query = OpenChannelListQuery()
    ..urlKeyword = 'seminar';

  final openChannels = await query.next();
} catch (e) {
  // Handle error.
}

You can also search for open channels with a specific custom type by setting customTypeFilter as in the following code.

try {
  final query = OpenChannelListQuery()
    ..customTypeFilter = 'movie';

  final openChannels = await query.next();
} catch (e) {
  // Handle error.
}