How to override IgnorePointer inside child of IgnorePointer?

Viewed 693

I've used IgnorePointer and everything works fine.

But there some widgets under IgnorePointer I want it to be able to react to a pointer.

How can I override the IgnorePointer for only that widget?

Stack(
    children: [
        MouseRegion(
            onHover: (_) {
            visibleController.awake();
            },
            child: GestureDetector(
                onTap: () {
                    // This one work
                    print("TAP...");
                },
                child: Container(color: Colors.red),
            ),
        ),
        IgnorePointer(
            ignoring: true,
            child: 
                child: Row(
                   children: [
                       GestureDetector(
                           onTap: () {
                              // This one doesn't work
                              print("Child inside IgnorePointer tapped"),
                          },
                          child: Container(),
                       ),
                       Container(),
                       Container(),
                    ],
                ),
            ),
        ),
    ],
);
1 Answers

IgnorePointer stops hit testing; none of its children will receive pointer events. If you want something that appears to be transparent in a stack but still hit tests its children you can use https://pub.dev/packages/transparent_pointer

Related