1

I'm referring to this issue right here: Drawing a line Between Widgets that have been already solved, but I have additional question about it.

I want to make the lines in the Stack widget clickable, but with GestureDetector widget it is not possible.

Do you have any solutions for me on how can I solve the problem. I would highly appreciate your answer guys!

Screenshot below: enter image description here

2 Answers2

0

try this:-

GestureDetector(
    onTap: (){
      //do your code on click
      },
      child: Container(
          width: 20,
          height: double.infinity,
          color: Colors.grey,
      ),
    )
hio
  • 915
  • 8
  • 26
0

You need to use a GestureDetector with the behavior: HitTestBehavior.translucent for it to be detectable with the CustomPaint.

Miguel Ruivo
  • 16,035
  • 7
  • 57
  • 87