isMemberOnly property Null safety

bool isMemberOnly

Checks whether users cannot join a chat group freely:

  • true: Yes. Needs the approval from the group owner(admin) or being invited by group members(PrivateOnlyOwnerInvite, PrivateMemberCanInvite, PublicJoinNeedApproval).
  • false: No. Users can join freely(PublicOpenJoin).

Note There are four types of group properties used to define the style of a group: {@link EMGroupManager.EMGroupStyle}.

Return Whether users can join a chat group with only the approval of the group owner(admin):

  • true: Yes. Needs the approval from the group owner(admin) or being invited by group members.
  • false: No.

Implementation

bool get isMemberOnly {
  if (_options == null) {
    return true;
  }

  if (_options?.style == EMGroupStyle.PrivateMemberCanInvite ||
      _options?.style == EMGroupStyle.PrivateOnlyOwnerInvite ||
      _options?.style == EMGroupStyle.PublicJoinNeedApproval) {
    return true;
  }
  return false;
}