Flutter- GestureDetector not working with containers in stack

前端 未结 10 824
一生所求
一生所求 2020-12-28 12:14

I have two containers in a stack and both containers have GestureDetector.The OnTap for the first container is working fine but it\'s not working with another container. The

10条回答
  •  既然无缘
    2020-12-28 12:37

    In my case I had a CustomPainter inside the stack. Nothing of the above was working, until I gave the CustomerPainter a size. It was showing without explicitly giving a size, but no tap events were triggered:

    Container(
          child: CustomPaint(
        size: Size(30, 30),
        painter: RecordingButton(30),
      ))
    

提交回复
热议问题