Flutter 如何设置颤振中识别器的文本点击获取错误

Flutter 如何设置颤振中识别器的文本点击获取错误,flutter,text,gesturedetector,Flutter,Text,Gesturedetector,如何设置颤振中识别器的文本点击获取错误-- 试试这个 GestureDetector( onTap: () { print("Pressed"); }, child: Text("GestureDetector"), ), InkWell( o

如何设置颤振中识别器的文本点击获取错误--

试试这个

            GestureDetector(
              onTap: () {
                print("Pressed");
              },
              child: Text("GestureDetector"),
            ),
            InkWell(
              onTap: () {
                print("Pressed");
              },
              child: Text("InkWell"),
            ),
            RichText(
              text: TextSpan(
                recognizer: new TapGestureRecognizer()
                  ..onTap = () {
                    print("Pressed");
                  },
                text: "RichText",
              ),
            )

我的文本视图已经设计好了,我只需要使编辑文本可点击无法更改所有视图Child:text(“编辑”,识别器:\识别器,我尝试了识别器,但在wideget类中定义的识别器出现错误。感谢@Reign RichText在我的案例中使用了一些代码编辑。
            GestureDetector(
              onTap: () {
                print("Pressed");
              },
              child: Text("GestureDetector"),
            ),
            InkWell(
              onTap: () {
                print("Pressed");
              },
              child: Text("InkWell"),
            ),
            RichText(
              text: TextSpan(
                recognizer: new TapGestureRecognizer()
                  ..onTap = () {
                    print("Pressed");
                  },
                text: "RichText",
              ),
            )