addGroupMembersAsync method

Future<void> addGroupMembersAsync(
  1. String groupId, {
  2. required List<String> membersToAdd,
  3. List<String> adminsToSet = const [],
  4. SealdGeneratedPrivateKeys? privateKeys,
})

Adds members to a group. Can only be done by a group administrator. Can also specify which of these newly added group members should also be admins.

groupId - The group in which to add members. membersToAdd - The Seald IDs of the members to add to the group. adminsToSet - The Seald IDs of the newly added members to also set as group admins. privateKeys - Optional. Pre-generated private keys, returned by a call to SealdSdk.generatePrivateKeysAsync.

Implementation

Future<void> addGroupMembersAsync(String groupId,
    {required List<String> membersToAdd,
    List<String> adminsToSet = const [],
    SealdGeneratedPrivateKeys? privateKeys}) {
  return compute(
      (Map<String, dynamic> args) => addGroupMembers(args["groupId"],
          membersToAdd: args["membersToAdd"],
          adminsToSet: args["adminsToSet"],
          privateKeys: args["privateKeys"]),
      {
        "groupId": groupId,
        "membersToAdd": membersToAdd,
        "adminsToSet": adminsToSet,
        "privateKeys": privateKeys
      });
}