getUsersInfo method

Future<V2TimValueCallback<List<V2TimUserFullInfo>>> getUsersInfo(
  1. Map<String, dynamic> params
)

Implementation

Future<V2TimValueCallback<List<V2TimUserFullInfo>>> getUsersInfo(
    Map<String, dynamic> params) async {
  try {
    final res = await wrappedPromiseToFuture(
        V2TIMManagerWeb.timWeb!.getUserProfile(mapToJSObj(params)));
    final code = res.code;
    if (code == 0) {
      final userListInfo = res.data as List;
      final userListResult = List.empty(growable: true);
      for (var element in userListInfo) {
        userListResult
            .add(V2TimProfile.userFullInfoExtract(jsToMap(element)));
      }
      return CommonUtils.returnSuccess<List<V2TimUserFullInfo>>(
          userListResult);
    }
    return CommonUtils.returnSuccess<List<V2TimUserFullInfo>>(List.empty());
  } catch (error) {
    return CommonUtils.returnErrorForValueCb<List<V2TimUserFullInfo>>(
        error.toString());
  }
}