Closed jifferon closed 3 years ago
Please, see this:
https://github.com/flutter/flutter/issues/19445
I could try to fix this in the future, but at the moment I'm not sure it's possible.
Please, see this:
I could try to fix this in the future, but at the moment I'm not sure it's possible.
I've been following this issue for a long time. Huge respect to you for carrying it.
I think you would share it already if you found a solution. So there isn't one yet, unfortunately, but if you can, you will make lots of things possible that are impossible to do now.
As a mechanical engineer and a Flutter developer myself too, I just wanted to thank you again for bringing so much value to this community. :)
This is fixed in version 2.0.4.
To see it working, please run this example:
https://github.com/marcglasberg/align_positioned/blob/master/example/lib/main_tap.dart
The example presents a circle which is half outside the AlignPositioned
area (in red), but feels the tap both inside and outside of that area. Tap it to see a color change. This is possible because the AlignPositioned
widget has a special hitText
method which does not cull the tap position.
However, all native Flutter widgets cull the tap position. If an AlignPositioned
is inside a native Flutter widget parent, that parent will cull the tap position, rendering the AlignPositioned
larger area useless. For more information, see:
For this reason, I don't think this feature is very useful in practice, unfortunately.
Update for anyone wanting to resolve this issue - look into defer_pointer
I've used this with success to enable gesture capture on widget regions painted outside of the parent widgets clipping boundary.
Try to recreate a sample code from the first example (with a semi-transparent circle on the left of the red container) and wrap that circle into
Material
->InkWell
.Tap will be recognized only if you tap on the overlapping with the red container section of the circle, otherwise, it will be ignored.
Working tap area is this:
Whereas anyone would expect it to be the whole circle widget.