【发布时间】:2023-03-31 03:35:02
【问题描述】:
尝试在颤振中运行时出现错误 (类型'String'不是'index'类型'int'的子类型)
void _submitForm() {
//cek validasi form
if (_formKey.currentState.validate()) {
FormFeedback formFeedback = FormFeedback(
nameController.text, emailController.text, feedbackController.text);
FormController formController = FormController((String response) {
if (response == FormController.STATUS_SUCCESS) {
_showSnackbar("feedback berhasil disimpan");
} else {
_showSnackbar("Error");
}
});
_showSnackbar("Menyimpan Feedback");
formController.submitForm(formFeedback);
}
I/flutter (18110):“String”类型不是“index”的“int”类型的子类型
【问题讨论】:
-
请将您的代码作为文本发布在代码时钟中。代码图片无法搜索并影响任何需要电子帮助的残障人士,因为常用工具在图片上的工作方式与在文本上的工作方式不同。最后但同样重要的是,我们不能只是将您的代码复制到我们的 IDE 中并在它是图片时对其进行测试。
-
检查你的 json 输出,也许有些东西是空的。
-
完成,我已编辑帖子
-
我在下面发布了我的 controller.dart 代码
标签: flutter