Flutter 导航问题(底部导航栏)
我在整个应用程序中都有持久的底部导航栏(除了登录页面)。它看起来像:Flutter 导航问题(底部导航栏),flutter,navigation,Flutter,Navigation,我在整个应用程序中都有持久的底部导航栏(除了登录页面)。它看起来像: Widget build(BuildContext context) { return Scaffold( body: IndexedStack( index: _currentIndex, children: <Widget>[ Navigator( key:_userScreen, onGenerateRoute
Widget build(BuildContext context) {
return Scaffold(
body: IndexedStack(
index: _currentIndex,
children: <Widget>[
Navigator(
key:_userScreen,
onGenerateRoute: (route) => MaterialPageRoute(
settings: route,
builder: (context) => UserPage(userId:
widget.userId),
),
),
),
Navigator(
key: _searchScreen,
onGenerateRoute: (route) => MaterialPageRoute(
settings: route,
builder: (context) => SearchPage(userId:
widget.userId),
),
),
Navigator(
key:_optionsScreen,
onGenerateRoute: (route) => MaterialPageRoute(
settings: route,
builder: (context) => OptionsPage(userId:
widget.userId),
),
),
]
),
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
selectedFontSize: 12.0,
unselectedFontSize: 12.0,
currentIndex: _currentIndex,
onTap: (val) => _onTap(val, context),
backgroundColor: Colors.blue[50],
items: [
BottomNavigationBarItem(
icon: Icon(LineIcons.graduation_cap),
title: Text('Courses'),
),
BottomNavigationBarItem(
icon: Icon(LineIcons.search),
title: Text('Search'),
),
BottomNavigationBarItem(
icon: Icon(LineIcons.user),
title: Text('Options'),
),
],
),
);
小部件构建(构建上下文){
返回脚手架(
正文:IndexedStack(
索引:_currentIndex,
儿童:[
领航员(
键:_userScreen,
OnGeneratorOute:(路线)=>物料管理路线(
设置:路线,
生成器:(上下文)=>UserPage(用户ID:
widget.userId),
),
),
),
领航员(
键:\ u搜索屏幕,
OnGeneratorOute:(路线)=>物料管理路线(
设置:路线,
生成器:(上下文)=>SearchPage(用户ID:
widget.userId),
),
),
领航员(
按键:_选项屏幕,
OnGeneratorOute:(路线)=>物料管理路线(
设置:路线,
生成器:(上下文)=>选项页(用户ID:
widget.userId),
),
),
]
),
底部导航栏:底部导航栏(
类型:BottomNavigationBarType.fixed,
selectedFontSize:12.0,
未选择的字体大小:12.0,
currentIndex:_currentIndex,
onTap:(val)=>\u onTap(val,上下文),
背景颜色:颜色。蓝色[50],
项目:[
底部导航气压计(
图标:图标(LineIcons.刻度盖),
标题:文本(“课程”),
),
底部导航气压计(
图标:图标(LineIcons.search),
标题:文本(“搜索”),
),
底部导航气压计(
图标:图标(LineIcons.user),
标题:文本(“选项”),
),
],
),
);
}
现在我想删除我的一个页面上的底部导航栏(用于打开视频播放器)。我怎么做?
我试着在我的应用程序的主界面中创建单独的视频页面路径,并使用Navigator.pushNamed到达那个里,但因为我位于另一个导航器中,所以我转到那个导航器的根页面