简体   繁体   English

Flutter,Dart,FireBase:[错误:颤振/lib/ui/ui_dart_state.cc(199)) - 无效的TAP异常

[英]Flutter, Dart, FireBase: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Invalid argument(s) - onTap GestureDetcture

I am getting the following error when I run my app.运行我的应用程序时出现以下错误。

[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Invalid argument(s) [错误:flutter/lib/ui/ui_dart_state.cc(199)] 未处理异常:无效参数

Exception caught by gesture Invalid argument(s)手势捕获的异常 无效的参数

错误

Code代码

onTap: () async {
                                  var userDetail = await FirebaseFirestore
                                      .instance
                                      .collection("Users")
                                      .doc(
                                          FirebaseAuth.instance.currentUser.uid)
                                      .get();
                                  final pID =
                                      userDetail.data()['ID'];

                                  final pName = userDetail.data()['Name'];
                                  var dName = snapshot.data.docs[index]
                                      .data()['Doc Name'];
                                  var dID = snapshot.data.docs[index]
                                      .data()['DocID'];
                                  var dcoumentID=
                                      pID + pName + dName + dID;
                                  Navigator.push(
                                    context,
                                    MaterialPageRoute(builder: (context) {
                                      return Screen1(
                                          doctor:
                                              snapshot.data.docs[index].data(),
                                          doctumentID:
                                              dcoumentID);
                                    }),
                                  );
                                },

This code works in the rest of the application only this part is throwing the error.此代码在应用程序的 rest 中有效,只有这部分会引发错误。

What am I doing wrong?我究竟做错了什么?

The mistake was in one of the fields I am trying to access, I did not add space.错误出现在我尝试访问的某个字段中,我没有添加空间。 Always check if you typed a field's name correctly, and a collection name correctly.始终检查您是否正确输入了字段名称和集合名称。 Thank you.谢谢你。

onTap: () async {
                                  var userDetail = await FirebaseFirestore
                                      .instance
                                      .collection("Users")
                                      .doc(
                                          FirebaseAuth.instance.currentUser.uid)
                                      .get();
                                  final pID =userDetail.data()['ID'];
    
                                      final pName = userDetail.data()['Name'];
                                      var dName = snapshot.data.docs[index]
                                          .data()['Doc Name'];
                                      var dID = snapshot.data.docs[index]
                                          .data()['Doc ID']; //changed field name
                                      var dcoumentID=
                                          pID + pName + dName + dID;
                                      Navigator.push(
                                        context,
                                        MaterialPageRoute(builder: (context) {
                                          return Screen1(
                                              doctor:
                                                  snapshot.data.docs[index].data(),
                                              doctumentID:
                                                  dcoumentID);
                                        }),
                                      );
                                    },

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:flutter/lib/ui/ui_dart_state.cc(199) 未处理的异常:无法启动 flutter 中的调用 - ERROR:flutter/lib/ui/ui_dart_state.cc(199) Unhandled Exception: could not lanch Call in flutter 错误:flutter/lib/ui/ui_dart_state.cc(166),未处理的异常:无效参数:“GoogleSignInAccount”实例 - ERROR:flutter/lib/ui/ui_dart_state.cc(166), Unhandled Exception: Invalid argument: Instance of 'GoogleSignInAccount' E/flutter(6866):[错误:flutter/lib/ui/ui_dart_state.cc(148)]未处理异常:无效参数 - E/flutter ( 6866): [ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: Invalid argument(s) E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] 未处理的异常:“String”类型不是“int”类型的子类型 - E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: type 'String' is not a subtype of type 'int' 错误:flutter/lib/ui/ui_dart_state.cc(199) 未处理的异常:Null 检查运算符用于 null 值 - ERROR:flutter/lib/ui/ui_dart_state.cc(199) Unhandled Exception: Null check operator used on a null value Flutter:[错误:flutter/lib/ui/ui_dart_state.cc(209)] 未处理的异常:PlatformException - Flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException Flutter:[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] 未处理异常 - Flutter :[ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception 错误 BLOC state [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] 未处理的异常:UnimplementedError - Error BLOC state [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: UnimplementedError 错误:flutter/lib/ui/ui_dart_state.cc(148) 未处理的异常 - ERROR:flutter/lib/ui/ui_dart_state.cc(148) Unhandled Exception 错误:flutter/lib/ui/ui_dart_state.cc(209) 未处理的异常:对象已被处置 - ERROR:flutter/lib/ui/ui_dart_state.cc(209) Unhandled Exception: Object has been disposed
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM