/ SDKs / Flutter
SDKs
Chat SDKs Flutter v3
Chat SDKs Flutter
Chat SDKs
Flutter
Version 3
Sendbird Chat SDK v3 for Flutter is no longer supported as a new version is released. Check out our latest Chat SDK v4

Retrieve a list of members and operators in a specific order

Copy link

The members and operators of a group channel can be retrieved by calling the loadNext() method of a GroupChannelMemberListQuery instance.

Note: Starting from Flutter Chat SDK 3.1.0, the GroupChannelMemberListQuery requires the channelUrl parameter.

Member list order

Copy link

For a specific order, set one of the values in the following table to the order property of a GroupChannelMemberListQuery.

ValueDescription

nicknameAlphabetical

Members are arranged in an alphabetical order. This is the default value.

operatorThenMemberNicknameAlphabetical

Operators are listed first, then the members, both in alphabetical order.

try {
    final query = GroupChannelMemberListQuery(channelUrl: channel.channelUrl)
        ..limit = 10
        ..order = operatorThenMemberNicknameAlphabetical;

    final result = await query.loadNext();
    // A list of matching members and operators is successfully retrieved.
} catch (e) {
    // Handle error.
}

Operator filter

Copy link

Set one of these values to the operatorFilter of a GroupChannelMemberListQuery.

ValueDescription

all

No filter is applied to the group channel list. This is the default value.

operator

Only operators are retrieved in the list.

nonOperator

All members, except for operators, are retrieved in the list.

try {
    final query = GroupChannelMemberListQuery(channelUrl: channel.channelUrl)
        ..limit = 10
        ..operatorFilter = OperatorFilter.operator; // all, operator, and nonOperator.

    final result = await query.loadNext();
    // A list of matching members and operators is successfully retrieved.
} catch (e) {
    // Handle error.
}