Overlay Widgets - Flutter

Asked

Viewed 403 times

0

When I activate the

Navigator.pushReplacement(
            context,
            CupertinoPageRoute(
                builder: (context) => ContactFound(key, index, model)));

This screen is under a menu (Instagram style).

I wonder if you have how to return this screen above all widgets. Could use stack but as I did not build the app and redo using this method would take too long.

Certain point of the code has a decision structure in which depending on what occurs returns a different screen.

EXAMPLE:

if(decisao == 1){
Navigator.pushReplacement(
            context,
            CupertinoPageRoute(
                builder: (context) => ContactFound(key, index, model)));
}

However, this screen returns over other widgets less than a menu at the bottom which is a CupertinoTabView (Instagram style). How could I return this screen above this menu ?

  • It was not clear your doubt, to trigger PushReplacement it will not stack itself and yes subistitui the current route by which was called, if you want to stack, then should call only the Push.

  • It wouldn’t be that. When I call it even that way this screen somehow sits underneath the app’s menu, as I said in the post

  • Strange theoretically was for the screen to stack on top of the current screen, even if there was a topbar or bottombar, without a little code gets complicated to visualize. If there is no way by code, show us how the structure of the screens is organized.

  • So I would like to post but as it is not of my own makes it complicated. I will try to post something to help in understanding the issue.

  • @Justcase I edited the question

  • 1

    I took a look at the cupertinotabview, it manages the stacking of the screens, why the screen is stacking under the menu. In the documentation it says that to stack a screen above the cupertinotabview, Voce should call the Navigator.of(rootNavigator: true) before stacking Ex: Navigator.of(context, rootNavigator: true).push( new CupertinoPageRoute<bool>(fullscreenDialog: true, builder: (BuildContext context) => ContactFound(key, index, model));

  • Dude It worked here but add that little arrow to come back, and when I give the pop, Uga again...at last you helped me a lot. Thanks

  • @Justcase create an answer pointing out what you mentioned in the comments, so that it is helpful if someone goes through the same problem as our friend there. PS: Place the links too that are very helpful.

  • All right, that’s something. When I get home I will fully reproduce this case, I use little the package of Upertino, so I was limited in helping you, and I will improve the response after I see completely.

  • I managed to solve the problem with some parameters in the app decision block so this ok so far kkk thank you very much

Show 6 more comments

1 answer

0


In the cupertinotabview it manages the status and history of stacking the screens, why the screen is stacking under the menu. In the documentation it says that to stack a screen above the cupertinotabview you should call Navigator.of(rootNavigator: true)before calling the Push. Ex: Navigator.of(context, rootNavigator: true).push( new CupertinoPageRoute<bool>(fullscreenDialog: true, builder: (BuildContext context) => ContactFound(key, index, model));

Complete Example

Cupertinotabview

Browser other questions tagged

You are not signed in. Login or sign up in order to post.