【发布时间】:2021-08-26 21:29:33
【问题描述】:
在颤振中,我想在所有屏幕上保留底栏,但是当我从对话框或底页导航到任何屏幕时,底栏就消失了。如何防止它被隐藏?
以下是我的代码。我通过单击按钮调用 showTheDialog()。
showTheDialog() {
showDialog(
context: context,
builder: (BuildContext context) {
return new AlertDialog(
title: new Text("My Super title"),
content: new Text("Hello World"),
actions: [
TextButton(
onPressed: () {
Navigator.pop(context);
gotoSecondScreen();
},
child: Text('Go Forward'),
)
],
);
});
}
gotoSecondScreen() {
pushNewScreen(
mainCon!,
screen: HomeF1Page(),
withNavBar: true, // OPTIONAL VALUE. True by default.
pageTransitionAnimation: PageTransitionAnimation.cupertino,
);
}
【问题讨论】:
-
因为你的所有屏幕都没有持久性 bottomNavBar !!
标签: flutter