getSpaceAdminsList function

List<String> getSpaceAdminsList(
  1. List<SpaceMemberDTO>? members,
  2. List<SpaceMemberDTO>? pendingMembers
)

Implementation

List<String> getSpaceAdminsList(
    List<SpaceMemberDTO>? members, List<SpaceMemberDTO>? pendingMembers) {
  final adminsFromMembers = members != null
      ? convertToWalletAddressListV2(
          members.where((admin) => admin.isSpeaker).toList())
      : <String>[];

  final adminsFromPendingMembers = pendingMembers != null
      ? convertToWalletAddressListV2(
          pendingMembers.where((admin) => admin.isSpeaker).toList())
      : <String>[];

  final adminList = [...adminsFromMembers, ...adminsFromPendingMembers];
  return adminList;
}