Flutter: CupertinoTabBar does not disappear when moving to the next screen

二次信任 提交于 2020-12-05 07:48:03

问题


I'm running the Flutter Gallery example from Google:

https://github.com/flutter/flutter/blob/master/examples/flutter_gallery/lib/demo/cupertino/cupertino_navigation_demo.dart

In the gif below, notice how when I navigate from one screen to the next, the Cupertino Tab Bar stays at the bottom of the screen. The reason why this is the case is that it is a widget that lays within the parent widget CupertinoNavigationDemo and while the tabs are swapped in and out of the view, the tab bar remains.

Is there a way to get rid of the Tab Bar when navigating?


回答1:


set rootNavigator: true

Navigator.of(context, rootNavigator: true).push(MaterialPageRoute(
      builder: (context) => "your new routes",
    ));


来源:https://stackoverflow.com/questions/50417283/flutter-cupertinotabbar-does-not-disappear-when-moving-to-the-next-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!