gskinnerTeam / flutter-defer-pointer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Not able to get it working with the latest flutter version - 3.13.7

rohanjsh opened this issue · comments

Widget build(BuildContext context) {
    return DeferredPointerHandler(
       child: SizedBox(
           width: 100,
           height: 100,
           child: Stack(clipBehavior: Clip.none, children: [
             // Hang button off the bottom of the content
             Positioned(
               bottom: -30,
               child: DeferPointer(child: _SomeBtn(false)),
             ),
             // Content
             Positioned.fill(
               child: Container(
                 decoration: BoxDecoration(color: Colors.green, boxShadow: [
                   BoxShadow(color: Colors.black.withOpacity(1), blurRadius: 4, spreadRadius: 4),
                 ]),
               ),
             ),
           ]))));
  }

When running the above sample code provided, I was not able to get it running on the latest flutter version.
No taps were detected.

It'll be great if anyone can look into this.
Thanks

@gskinner

I've just tried with Flutter 3.13.8 and it works. Is your DeferredPointerHandler obscured (a part of it) by any outside widget?

I don't think so, I tried running above example in my app but it did not detect any taps, it may be possible I am wrong somewhere.

For our usecase (with some complexity) widget tree looks something like this.
Screenshot 2023-10-25 at 12 43 45

Also, just to mention I tried using the link parameter as well, but it still didn't work.

@rohanjsh try to move DeferredPointerHandler outside of BlocBuilder, or even far more to check whether it works. If not too special, there's no need to use link.

Awesome, that worked.
Thank you @vietstone-ng for saving the day 🤩

Closing the issue.