【发布时间】:2021-11-08 01:18:54
【问题描述】:
我正在使用Persistent Bottom Navigation Bar package,但我遇到了问题。我有一个主页,其中包含 4 个选项卡(个人资料、收藏夹、搜索、流派)和所有这些选项卡的主应用栏。当我从这些选项卡之一(例如favorites_page)导航到内部页面(movie_details_page)时,它有自己的应用栏,标题为电影名称,来自home_page的应用栏也导航到movie_details_page。有没有办法避免这种情况?
这是我的主页脚手架:
Scaffold(
appBar: AppBar(
title: Text("MOVIEW"),
elevation: 0,
),
body: PersistentTabView(
context,
confineInSafeArea: true,
screens: [
GenresPage(),
SearchPage(),
ProfilePage(
email: moview.email,
password: moview.password,
username: moview.username,
),
FavoritesPage(),
],
controller: _controller,
items: [
PersistentBottomNavBarItem(
icon: Icon(Icons.grid_view),
activeColorPrimary: Theme.of(context).accentColor,
activeColorSecondary: Colors.white,
inactiveColorPrimary: Colors.grey,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.search_rounded),
activeColorPrimary: Theme.of(context).accentColor,
activeColorSecondary: Colors.white,
inactiveColorPrimary: Colors.grey,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.person),
activeColorPrimary: Theme.of(context).accentColor,
activeColorSecondary: Colors.white,
inactiveColorPrimary: Colors.grey,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.favorite_border_rounded),
activeColorPrimary: Theme.of(context).accentColor,
activeColorSecondary: Colors.white,
inactiveColorPrimary: Colors.grey,
),
],
popActionScreens: PopActionScreensType.all,
itemAnimationProperties: ItemAnimationProperties(
duration: Duration(milliseconds: 450),
curve: Curves.easeInOutQuart,
),
screenTransitionAnimation: ScreenTransitionAnimation(
animateTabTransition: true,
duration: Duration(milliseconds: 450),
curve: Curves.easeInOutQuart,
),
backgroundColor: Theme.of(context).primaryColor,
hideNavigationBarWhenKeyboardShows: true,
navBarStyle: NavBarStyle.style3,
),
);
这是主页中我最喜欢的页面标签:
这是movie_details_page:
PS:请不要评判我的 UI :)
这只是为了测试。
【问题讨论】:
标签: flutter dart flutter-packages