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

Exposing clipBehavior for nested navigation #2082

Open
dorklein opened this issue Nov 3, 2024 · 0 comments
Open

Exposing clipBehavior for nested navigation #2082

dorklein opened this issue Nov 3, 2024 · 0 comments

Comments

@dorklein
Copy link

dorklein commented Nov 3, 2024

The shadow is being clipped when using AutoRouter() for nested navigation and the nested page as a shadow.

Expected behavior

Screenshot 2024-11-03 at 12 31 04

I'm setting the card on the page instead of AutoRouter()

// Parent page
@override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Container(
          margin: const EdgeInsets.all(4),
          padding: const EdgeInsets.all(16),
          decoration: const BoxDecoration(
            borderRadius: BorderRadius.all(Radius.circular(16)),
            color: Colors.white,
            boxShadow: [...],
          ),
          child: const Text('Box with shadow'),
        ),
      ),
    );
}

Actual behavior

Screenshot 2024-11-03 at 12 39 42

Setting AutoRouter(), and the nested page has the card

// Nested page
@override
  Widget build(BuildContext context) {
      return Container(
          margin: const EdgeInsets.all(4),
          padding: const EdgeInsets.all(16),
          decoration: const BoxDecoration(
            borderRadius: BorderRadius.all(Radius.circular(16)),
            color: Colors.white,
            boxShadow: [...],
          ),
          child: const Text('Box with shadow'),
        );
}

// Parent page
@override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: AutoRouter(),
      ),
    );
}

Inspecting the AoutRouter() with the flutter devtools shows a Stack in there, I'm not sure if it's from auto_route or from Flutter Navigator.
Stack is one of a few widgets that has a Clip.hardEdge bydefault from flutter docs
There should be a way to expose and set the clipBehavior: Clip.none

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

1 participant