storyboard icon indicating copy to clipboard operation
storyboard copied to clipboard

Dialogs show up in the StoryBoard "host" window

Open rydmike opened this issue 4 years ago • 3 comments

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 avatar May 06 '20 17:05 rydmike

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

rodydavis avatar May 10 '20 05:05 rodydavis

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 avatar May 12 '20 08:05 rydmike

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.

rydmike avatar May 12 '20 09:05 rydmike