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

Join and leave a group channel

Copy link

By default, an invitation is required to join group channels. However, any user can join public group channels as a member without invitations as shown below. Users can join up to 2,000 group channels.

try {
  if (groupChannel.isPublic) {
    await groupChannel.join();
  }
} catch (e) {
  // Handle error.
}

A user can leave group channels as shown below. After leaving, the user can't receive messages from the channel, and this method can't be called for deactivated users.

If the user is the channel's operator, you can remove the user from the channel's operator list by setting the shouldRemoveOperatorStatus parameter to true.

try {
  await groupChannel.leave();
} catch (e) {
  // Handle error.
}