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

Dialogs show up in the StoryBoard "host" window #7

Open
rydmike opened this issue May 6, 2020 · 3 comments
Open

Dialogs show up in the StoryBoard "host" window #7

rydmike opened this issue May 6, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@rydmike
Copy link

rydmike commented May 6, 2020

When an app screen in a story board show a dialog, it shows up in the story boards "host" canvas and is not constrained to the "screen" it originated from. This might or might not be a desirable feature, mostly it is probably not desired if you are presenting a mobile app UI:

image

@rydmike rydmike changed the title Dialogs show up the StoryBoard "host" window Dialogs show up in the StoryBoard "host" window May 6, 2020
@rodydavis rodydavis added the bug Something isn't working label May 6, 2020
@rodydavis rodydavis self-assigned this May 6, 2020
@rodydavis
Copy link
Owner

This is because flutter by default looks up the root navigator. You can have it appear correctly
by doing the following:

 showDialog(
              context: context,
              useRootNavigator: false,
              builder: (context) {
                return AlertDialog(
                  title: Text('Info'),
                  content: Text('Dialog Test'),
                );
              });

Screen Shot 2020-05-09 at 10 03 29 PM

@rydmike
Copy link
Author

rydmike commented May 12, 2020

That's true. I will test and verify in the app where I used StoryBoard that setting useRootNavigotor to false on all show dialog calls don't cause any other issues in the app. If it does not, then this is certainly a good enough work around.

@rydmike
Copy link
Author

rydmike commented May 12, 2020

I just tested this, changed all useRootNavigator settings to false. While it did not have any perceivable effect on the functionality of the app, it also did not solve the issue. All dialogs still show up in the host app's viewport.

This happens at least when using the StoryBoard() as an in-app feature with customLanes. It solves the issue the issues when you wrap you entire app with StoryBoard though, like shown in your example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants