title: Flutter, Dart, FireBase: [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Invalid argument(s) - onTap GestureDetcture
body: <p>I am getting the following error when I run my app.</p>
  <blockquote>
  <p>[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Invalid argument(s)</p>
  </blockquote>
  <blockquote>
  <p>Exception caught by gesture   Invalid argument(s)</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/9zWcA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9zWcA.png" alt="Error" /></a></p>
  <p><strong>Code</strong></p>
  <pre><code>onTap: () async {
                                    var userDetail = await FirebaseFirestore
                                        .instance
                                        .collection(&quot;Users&quot;)
                                        .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);
                                      }),
                                    );
                                  },
  </code></pre>
  <p>This code works in the rest of the application only this part is throwing the error.</p>
  <p>What am I doing wrong?</p>