Chat / Flutter
Current version: v3
Chat Flutter v3
Chat Flutter
Chat
Flutter
Home
/
Chat
/
Flutter
/
User

Retrieve a list of members and operators in a specific order

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

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

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.
}