Browse SDKs · Flutter
SDKsFlutter

Create a group

Create an OpenIM group and configure its initial members with the Flutter SDK.

Copy
final group = await OpenIM.iMManager.groupManager.createGroup(
  groupInfo: GroupInfo(groupID: '', groupName: 'Project discussion', groupType: GroupType.work),
  memberUserIDs: ['user-003'],
  adminUserIDs: ['user-002'],
  ownerUserID: currentUserID,
);

Do not include the same user as a regular member, administrator, and owner. A successful Future returns the new GroupInfo; merge group-list increments through onJoinedGroupAdded.