如何使抽屉底部导航栏



我想要有底部导航栏和抽屉在我的应用程序。当我打开抽屉然后我的底部菜单在下面。真希望是底部导航栏下的抽屉。有可能吗?

我代码:

Scaffold(
key: _scaffoldKey,
appBar: PreferredSize(
preferredSize: Size(0.0, 0.0),
child: Container(),
),
drawer: DrawerWidget(Theme.of(context).brightness, _selectedDrawerIndex, onSelectItem, widget._operator.plannerEnabled, widget._operatorRepository),
body: _getDrawerItemWidget(_selectedDrawerIndex),
floatingActionButton: !_showBottoNav() && plannerEnabled
? FloatingActionButton(
elevation: 0.0,
backgroundColor: Theme.of(context).primaryColor,
child: Icon(
Icons.arrow_forward,
color: Colors.white,
),
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => ChangeNotifierProvider(
create: (context) => PlannerHomeViewModel(context, widget._operator, null, null, null),
child: PlannerHomeScreen(),
),
),
);
},
)
: null,
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
bottomNavigationBar: !_showBottoNav()
? BottomNav(
onTap: changeSelectedIndex,
openMenu: manageDrawer,
showPlanner: plannerEnabled,
currentIndex: _selectedDrawerIndex ?? 1,
)
: null,
),

您只需要像这样嵌套两个Scaffolds:

Scaffold(
body: Scaffold(
appBar: AppBar(),
drawer: Drawer(),
),
bottomNavigationBar: BottomNavigationBar(
items: [
BottomNavigationBarItem(icon: Icon(Icons.home), label: 'Home'),
BottomNavigationBarItem(icon: Icon(Icons.person), label: 'Profile'),
],
),
)

相关内容

  • 没有找到相关文章

最新更新