Skip to content

Conversation

@Yegair
Copy link

@Yegair Yegair commented Feb 8, 2025

I am using this library in combination with ShellRoutes from go_router. I.e. I have a shell that renders a screen with a bottom navigation bar and a body that depends on the navigation of the user. This leads to multiple navigators and thus multiple Overlay being present in the context when inserting a guide. Since the current implementation always uses the nearest ancestor overlay, it uses the one from the screen that is wrapped by the ShellRoute. This in turn leads to the mask not covering the bottom navigation bar.

To solve this issue, I added a new parameter overlay, which can be used like this:

// somewhere up the widget tree
final overlay = Overlay.of(context);

// pass it to the Intro somewhere down the widget tree
// (I am using a custom InheritedWidget to bypass the other navigators/overlays in the hierarchy,
// but I assume just using a GlobalKey would also work)
Intro(
  overlay: overlay,
  child: ...,
)

Since my first attempt of solving the issue was simply using the root overlay, I also added another parameter to do so:

Intro(
  useRootOveraly: true, // now the Intro will internally call Overlay.of(context, rootOverlay: true) to resolve the overlay
  child: ...,
)

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

Successfully merging this pull request may close these issues.

1 participant