getAdminsList function

List<String> getAdminsList(
  1. List<MemberDTO>? members,
  2. List<MemberDTO>? pendingMembers
)

Implementation

List<String> getAdminsList(
    List<MemberDTO>? members, List<MemberDTO>? pendingMembers) {
  final adminsFromMembers = members != null
      ? convertToWalletAddressList(
          members.where((admin) => admin.isAdmin).toList())
      : <String>[];

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

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