inviteUserToGroup method

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

Implementation

Future<dynamic> inviteUserToGroup(Map<String, dynamic> params) async {
  try {
    final addGroupMemberParams = InviteUserToGroup.formatParams(params);
    final res = await wrappedPromiseToFuture(
        timeweb!.addGroupMember(addGroupMemberParams));
    if (res.code == 0) {
      final result = InviteUserToGroup.formatResult(jsToMap(res.data));
      return CommonUtils.returnSuccess<List<V2TimGroupMemberOperationResult>>(
          result);
    }
    return CommonUtils.returnErrorForValueCb<
        List<V2TimGroupMemberOperationResult>>('invite failed');
  } catch (error) {
    return CommonUtils.returnErrorForValueCb<
        List<V2TimGroupMemberOperationResult>>(error);
  }
}