颤动如何阻止文本阻止手势检测?

时间:2018-04-15 17:12:36

标签: dart flutter

我有一个容器'包裹在“手势检测器”中。我已经添加了' Text'通过“容器”#39;在运行时和'文本'阻止了“容器”的部分内容。从检测手势。如何防止'文字'从阻止手势检测?

class MyButton extends StatefulWidget {
@override
_MyButtonState createState() => new _MyButtonState();
}

class _MyButtonState extends State<MyButton> {
 @override
 Widget build(BuildContext context) {
 return new GestureDetector(
   onTapDown: myTapDown,
   child: new Container(),
  );
 }

void myTapDown(TapDownDetails details) {
 showDialog(
   context: context,
   child: new Text(
    'SOME TEXT',
    textScaleFactor: 2.0,
   ),
  );
 }
}

class MyPage extends StatefulWidget {
@override
_MyPageState createState() => new _MyPageState();
}

class _MyPageState extends State<MyPage> {
@override
Widget build(BuildContext context) {
return new Stack(
  children: <Widget>[
    new MyButton(),
    new Column(
      children: <Widget>[new Text('NAME'),new Text('NUMBER')],
      )
    ],
  );
 }
}

0 个答案:

没有答案