I need for certain use nested inkwell and need to add separate function onTap
. How should I make it work.
Please find a sample code here-
InkWell(
onTap: () => print("1st inkwell"),
child: InkWell(
onTap: () => print("2nd inkwell"),
child: Icon(Icons.close),
),
),
3
Answers
When you nest InkWell widgets, the inner InkWell typically captures the tap gesture. This means that the outer InkWell might not receive the tap event if the inner one is absorbing it.
So use GestureDetector with InkWell. Replace your first Inkwell with GestureDetector
I have tried with IgnorePointer, check if it helps you
Use
GestureDetector
and setbehavior
toHitTestBehavior.translucent
to allow the tap to be passed to the child.Try below code hope its help:
I have try using HitTestBehavior, Read more about GestureTapCallback