首页 > 解决方案 > 两个连接颤动未调用

问题描述

我有这个在我的应用程序中正确调用的类。结构是这样的:

我不知道为什么他只是称我为两者之一而不是他应该做什么: Connection().pendingUnitRegistration

这个调用是正确的,但之后它不会使 Connection().units(

为什么?我该如何解决?我必须在 onValidate 中进行这两个调用

 EmailOtp(
    onValidate: (otp) async {
      var user =
          await Connection().getUserInfo(id: "me");
      if (user == null) {
        Fluttertoast.showToast(
            msg:
                "Al momento non è possibile continuare la registrazione");
        logger
            .w("Merchant registration: user was null");
      }
      var valid =
          await Connection().pendingUnitRegistration();
      if (valid) {
        Connection().units(
            address: sedeLegale.address,
            businessName: ragSoc,
            // todo che fare nel (remoto) caso in cui sia null?
            cap: sedeLegale.cap ?? "n/a",
            categoryId: 2,
            city: sedeLegale.city,
            createdBy: user!.createdBy,
            email: user.username,
            firstName: user.firstName,
            fiscalCode: user.fiscalCode,
            fiscalRegime: regFis,
            geoX:
                sedeLegale.coords!.latitude.toString(),
            geoY:
                sedeLegale.coords!.longitude.toString(),
            hasCustomInvoicing: true,
            iban: "",
            imageId: user.imageId,
            isPA: true,
            legalNature: natLeg,
            otp: otp,
            phone: user.phone,
            province: sedeLegale.provence!,
            recipientCode: codDes,
            roleId: 2,
            scopeId: 2,
            statusId: 2,
            storeName: sedeLegale.name,
            unitOwnerId: 2,
            vatNumber: iva);
      }
      return true;
    },
    onEnd: () =>
        Get.to(() => TerminatedPage(finishPage: true)),
    requestNewOtp: () async {
      var data =
          await Connection().getUserInfo(id: "me");
      Connection().pendingRegistration(
          email: data!.username,
          phonePrefix: data.phone.substring(0, 3),
          phoneNumber: data.phone.substring(3));
      //TODO implement
    },
  )

标签: flutterconnection

解决方案


推荐阅读