getGroupsInfo method

Future getGroupsInfo(
  1. Map<String, dynamic> params
)

Implementation

Future<dynamic> getGroupsInfo(Map<String, dynamic> params) async {
  try {
    final groupIDs = params['groupIDList'];
    final groupsInfoList = List.empty(growable: true);
    for (String id in groupIDs) {
      final res = await getGroupProfile(id);
      groupsInfoList.add(res);
    }
    final res = groupsInfoList.map((element) {
      final groupInfo =
          V2TimGroupCreate.convertGroupResultFromWebToDart(jsToMap(element));
      return {'resultCode': 0, 'resultMessage': 'OK', 'groupInfo': groupInfo};
    });
    return CommonUtils.returnSuccess<List<V2TimGroupInfoResult>>(
        res.toList());
  } catch (error) {
    return CommonUtils.returnErrorForValueCb<List<V2TimGroupInfoResult>>(
        error.toString());
  }
}