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

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 next() method of a MemberListQuery instance.

Member list order

Copy link

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

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 = MemberListQuery(channelUrl: groupChannel.channelUrl)
    ..limit = 10
    ..order = operatorThenMemberNicknameAlphabetical;

  final result = await query.next();
  // 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 MemberListQuery.

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 = MemberListQuery(channelUrl: groupChannel.channelUrl)
    ..limit = 10
    ..operatorFilter = OperatorFilter.operator; // all, operator, and nonOperator.

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