getOtherMembersRoomInfo static method

Future<List<OtherMemberRoomInfo>> getOtherMembersRoomInfo(
  1. String thisMemberId,
  2. String appId,
  3. List<String> memberIds
)

Implementation

static Future<List<OtherMemberRoomInfo>> getOtherMembersRoomInfo(
    String thisMemberId, String appId, List<String> memberIds) async {
  List<OtherMemberRoomInfo> otherMembersRoomInfo = [];
  for (var memberId in memberIds) {
    if (memberId != thisMemberId) {
      var member =
          await memberPublicInfoRepository(appId: appId)!.get(memberId);
      if (member != null) {
        var otherMemberRoomInfo = OtherMemberRoomInfo(
            memberId: member.documentID,
            name: (member.name != null && member.name!.isNotEmpty)
                ? member.name!
                : 'No name',
            avatar: member.photoURL);
        otherMembersRoomInfo.add(otherMemberRoomInfo);
      }
    }
  }
  return otherMembersRoomInfo;
}