flutter - 两个连接颤动未调用
问题描述
我有这个在我的应用程序中正确调用的类。结构是这样的:
- onValidate: 是我遇到问题时首先调用的。
我不知道为什么他只是称我为两者之一而不是他应该做什么: 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
},
)
解决方案
推荐阅读
- php - 错误 2002 连接在 PHP 连接到 MAMP 上运行的 MySQL 时被拒绝
- python-2.7 - 从“显示端口通道摘要”构建的python字典
- ios - BezierPath clipShape 问题
- isabelle - 在没有局部假设的情况下在 Isar 中证明定理
- javascript - Qualtrics:如何记录显示给参与者的动态文本版本?
- python - 根据索引拆分 train_test_split 的数据帧
- discord.js - Discord.js 如何让机器人将用户发送的内容插入 url?
- c - 打印传感器状态 pic18f4520 时出现无限循环错误
- multilingual - 构建动态多语言 Wix 页面的解决方法?
- javascript - 为什么 XMLHttpRequest 的 document.body.innerText 属性与浏览器中的 document.body.innerText 属性不同?