Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working with padding arround #1

Open
EArminjon opened this issue Dec 13, 2021 · 1 comment
Open

Not working with padding arround #1

EArminjon opened this issue Dec 13, 2021 · 1 comment

Comments

@EArminjon
Copy link

EArminjon commented Dec 13, 2021

 return Padding(
      padding: const EdgeInsets.only(top: 16),
      child: 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: TextButton(onPressed: () => print("lol"), child: Text("lol"))),
              ),
              // Content
              Positioned.fill(
                child: Container(
                  decoration: BoxDecoration(color: Colors.green, boxShadow: [
                    BoxShadow(color: Colors.black.withOpacity(1), blurRadius: 4, spreadRadius: 4),
                  ]),
                ),
              ),
            ],
          ),
        ),
      ),
    );

image

The lol button is not clickable outside the green block.

@esDotDev
Copy link
Contributor

esDotDev commented Dec 22, 2021

I think this is because the padding is tightly wrapping your content, giving you only 16px of more area to detect hits.

Try swapping the Padding and the DeferredPointerHandler? Or just put a single DeferredPointerHandler at the top of your app to keep it simple if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants