persistent_bottom_nav_bar_v2 6.2.0
persistent_bottom_nav_bar_v2: ^6.2.0 copied to clipboard
A highly customizable bottom navigation bar for Flutter. Includes 17 prebuilt styles but can also be used with your custom style.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
6.0.1 - 2025-05-18 #
Fixed #
- If no custom NavigatorKeys were specified, the state of each tab got lost when reloading.
6.0.0 - 2025-05-17 #
Added #
- Hide the NavBar on scroll: Set
hideOnScrollVelocityto x (x != 0) to make the NavBar disappear after x pixels have been scrolled (and reappear respectively) SelectedTabPressConfig, which is responsible for any configuration when the selected tab is pressed again.SelectedTabPressConfig.popActionallows to specify how many screens of the current tab should be popped if the tab is pressed againSelectedTabPressConfig.scrollToTopenables automatically scrolling the tab content to top if the current tab is pressed again. This requires a ScrollController on eachPersistentTabConfig.scrollControllerfor each tab this should be activated for.SelectedTabPressConfig.onPressedis a callback that gets executed whenever the current tab is pressed again. I also provides an argument whether there are any pages pushed to the tab.
- Navigator function that pop all screens of the current tab:
popAllScreensOfCurrentTab - Animated Icons: Animate the navigation bar icons by using the provided
AnimatedIconWrapper(see README for more) - PersistentTabController now gives you access to the previousIndex
Breaking Changes #
- Change the default of
navBarOverlaptoNavBarOverlap.none()(previously wasNavBarOverlap.full()) - Removed ItemConfig.opacity. Instead, set the opacity on the NavBarDecoration.color directly
- Removed ItemConfig.filter. Use NavBarDecoration.filter instead
- Removed default value of NavBarDecoration.filter
- Removed
selectedTabContext. Use the list of your tabs instead to get the current tab context like so:tabs[controller.index].navigatorConfig.navigatorKey.currentContext - Removed
PersistentTabController.onIndexChanged. UsePersistentTabController.listeninstead. - Replaced
popAllScreensOnTapAnyTabswithkeepNavigatorHistory. The meaning (and default value) of this parameter is thus inverted. To migrate, flip the boolean value for that parameter if you use it. - Combined
popAllScreensOnTapOfSelectedTabandpopActionScreensinto theSelectedTabPressConfig.popAction.- Set
SelectedTabPressConfig.popActiontoPopActionType.allto pop all screens of the selected tab if it is pressed again - Set
SelectedTabPressConfig.popActiontoPopActionType.singleto pop a single screen of the selected tab if it is pressed again - Set
SelectedTabPressConfig.popActiontoPopActionType.noneto do nothing if it the selected tab pressed again
- Set
- Replaced
onSelectedTabPressWhenNoScreensPushedwithSelectedTabPressConfig.onPressed. TheonPressedparameter informs you whether any pages are currently pushed to that tab. - Removed
navBarHeightparameter. Use theheightparameter of each style instead if needed.heightis not mandatory, so by default no specific height is set. UsekBottomNavigationBarHeightif you want the default previous behavior.
Fixed #
- Adjusting the number of tabs at runtime threw an error
- The state of each tab was not disposed if stateManagement was true and gestures were enabled
5.3.1 - 2024-10-03 #
Fixed #
- Improve documentation on the historyLength (https://github.com/jb3rndt/PersistentBottomNavBarV2/pull/138)
- Fix opacity overriding NavBarDecoration color (https://github.com/jb3rndt/PersistentBottomNavBarV2/issues/181)
5.3.0 - 2024-07-06 #
Fixed #
- Only dispose PersistentTabController if it is automatically created. If you pass your own, you are responsible to dispose it manually.
- Handle popAllScreensOnTapAnyTabs correctly
5.2.3 - 2024-04-24 #
Fixed #
- popAllScreensOnTapOfSelectedTab and onSelectedTabPressWhenNoScreensPushed did not work properly when an initialRoute was set for that tab
5.2.2 - 2024-04-11 #
Fixed #
- NavigatorConfig.initialRoute did not get passed to the respective Navigator
- Mark ItemConfig.color and filter as deprecated
5.2.0 - 2024-04-03 #
Changed #
- Mark onWillPop as deprecated
Fixed #
- Navigator.copyWith didn't properly copy the navigatorKey
- Rewrite usage of PopScope by providing
canPop: truewhen all child navigators are clear and the initial tab is selected to the give pop control to the ancestors or correctly pop/close the app if no parent PopScope exists (thus maintaining natural PopScope behavior) - PopScope now just blocks popping until the initial tab is selected and the child navigator cant be popped anymore
5.1.0 - 2024-03-28 #
Fixed #
- Fix deprecation of colorScheme.background
- The Main Scaffold only extends its body if necessary (full overlap or hidden navbar) to prevent unnecessary padding (equal to navbar height)
- Replace NavBar SlideTransition with SizeTransition to correctly report its size to the Main Scaffold
- Pass on the source padding to the Main Scaffold Body if the navbar is hidden
- Pass the source viewPadding if navbar is hidden and the new body padding of the Main Scaffold as a new viewPadding to the tabs to ensure better placement of FABs on individual screens
- Prevent Navbar jumping when keyboard opens because the keyboard consumes the MediaQuery.padding.bottom
- Prevent Navbar jumping when keyboard opens because the keyboard consumes the MediaQuery.padding.bottom
- Fix tabs overlaying each other if no transition animation should be shown
5.0.0 - 2024-03-13 #
Added #
- Easier and less error-prone usage api (MIGRATION GUIDE)
- Support for go_router
- Change the tab by sliding left/right (if enabled)
Fixed #
- A ton of internal improvements
5.0.0-beta.10 - 2024-03-13 #
5.0.0-beta.9 - 2024-03-04 #
5.0.0-beta.7 - 2023-12-06 #
Fixed #
- Upgrade go_router to 12.1.1
- Make page switching transition rtl compatible
- Fix _animation not initialized error
- Switching tabs without stateManagement caused re-initializations of all loaded pages
5.0.0-beta.6 - 2023-09-12 #
4.2.8 - 2023-03-27 #
Fixed #
- Remove label padding in simple style
- Check if context is non-null before popping all screens
5.0.0-beta.5 - 2023-02-27 #
5.0.0-beta.3 - 2023-02-12 #
5.0.0-beta.1 - 2022-11-19 #
Breaking Changes #
itemAnimationProperties,neumorphicPropertiesandnavBarDecorationnow have to be applied to the NavBar Widget directly- navBarStyle now is a widget builder which also allows to pass a custom Widget instead of only the predefined ones
- Remove
PersistenTabView.custom(usePersistentTabViewinstead) constructor - Make items primary color the title and icon color and secondary the background color
backgroundColornow changes the color of the backgroundNavBarOverlapreplaces thebuttomScreenMargin
Changed #
- Remove PersistentTabViewBase
- Replace
CupertinoPageScaffoldwithScaffold - Trimmed the styles
- Make inactiveIcon default to icon globally
- Tabs Navigators inherit the settings of the root Navigator
- Make null-safety safer
4.2.7 - 2022-11-13 #
Fixed #
- Scroll to top on iOS (#34 via #72)
- Fix text color in dark mode on iOS (#71)
4.2.5 - 2022-08-16 #
Fixed #
- Fix cast error when using
onWillPopwithhandleAndroidBackButtonPress: false
4.2.3 - 2022-06-03 #
Fixed #
selectedTabScreenContextreturned a wrong context after visiting the tabs the first time
4.2.1 - 2022-05-29 #
4.2.0 - 2022-05-23 #
Changed #
- Fixed bug where the NavigatorObservers of a custom PersistenTabView threw errors when switching to another tab
- Fixed using the correct navigatorKeys for the correct tab
- Breaking Change: The
CustomWidgetRouteAndNavigatorSettings.navigatorObserversare now a list of lists of NavigatorObservers, so each tab has its own list of NavigatorObervers. See the attribute for more information and an example
4.1.11 - 2022-05-13 #
Changed #
- Support Flutter 3.0.0 without triggering warnings (see
_ambiguatefunction for more)
4.1.10 - 2022-04-25 #
4.1.5 - 2022-03-17 #
Fixed #
- Fix issue with
navbarDecoration.borderRadiusbeing null but expected to not be null by styles 15 and 16
4.1.4 - 2022-03-17 #
4.1.1 - 2022-01-20 #
Fixed #
- Hotfix for
popAllScreensOnTapOfSelectedTabofPersistentTabView.custom PersistentTabView.customnow also needs the items- You have to call
navBarEssentials.onItemSelected(index)to trigger navigator stack clearing - Breaking:
customWidgetnow is a builder that receivesnavBarEssentials - Breaking: To make
popAllScreensOnTapOfSelectedTabwork, specify youronItemSelectedfunction of theCustomWidgetlike this:
4.1.0 - 2022-01-20 #
4.0.3 - 2022-01-20 #
Changed #
- Republish package to persistent_bottom_nav_bar_v2
4.0.2 - 2021-03-27 #
Fixed #
- Fixed error while pushing new screens through the included Navigator functions.
3.2.0 - 2021-03-21 #
Added #
inactiveIconis now available inPersistentBottomNavBarItem.- Fixed the bug where all screens of a tab would be popped while switching between tabs.
- Bug fixes.
- Breaking Changes
onWillPopfunction now will return the selected screen's context.- PersistentBottomNavBarItem
routeAndNavigatorSettingshas been removed for non-custom navigation bar. Instead, you must now declarerouteAndNavigatorSettingsinPersistentBottomNavBarItem.activeColoris nowactiveColorPrimary.inactiveColoris nowinactiveColorPrimary.activeColorAlternateis nowactiveColorSecondary.onPressednow returns context of the selected screen.
3.1.0 - 2020-12-06 #
Added #
- Argument
routeAndNavigatorSettingsadded to handleNavigator.pushNamed(context, 'routeName'). Please define your routes and other navigator settings like navigator observers here as well. - Breaking Changes
- Arguments
initalRoute,navigatorObserversandnavigatorKeysremoved and shifted torouteAndNavigatorSettings.
3.0.0 - 2020-12-06 #
Added #
- Added new arguments
navigatorObserversandnavigatorKeysfor the main navigation bar widget. - No need to call
setStatewhen updating active tab using the PersistentTabController. - Function argument
selectedTabScreenContextexposescontextof the selected tab. - Bug fixes and code refactoring.
- Breaking Changes
contextis now required in the constructor.- For custom widget, use this constructor
PersistentTabView.custom(). NavBarStyle.customhas been removed. Please usePersistentTabView.custom().- Argument
iconSizehas been shifted to PersistentBottomNavBarItem. - PersistentBottomNavBarItem argument
activeContentColor's name has been changed toactiveColorSecondary. Functionality remains the same. - PersistentBottomNavBarItem argument
titleStyle's name has been changed totextStyle. Functionality remains the same.
2.1.0 - 2020-10-02 #
Added #
- Added
TextStyleproperty for title in the PersistentBottomNavBarItem. - Added
marginproperty for the navigation bar. - Bug fixes.
2.0.0 - 2020-07-15 #
Added #
- Added transition animations to the Navigator functions.
- Padding simplified into a single property and uses
NavBarPaddinginstead of EdgeInsets. - New property called 'decoration' where are decoration related properties have been moved like curveRadius, boxShadow etc.
- New property to hide the Navigation Bar when keyboard appears.
- For those wanting to display a custom dialog when user tries to exit the app on Android only, use
onWillPopthe callback function. - 8 new styles added.
- Animation properties for all styles can now be controlled through the property
itemAnimationProperties. - Ability to turn off state management.
- Screen transition animation added. Can be controlled with the property
screenTransitionAnimation. - Ability to use custom behavior on tapping of a navigation bar's tab/item through
onPressedcallback method in thePersistentBottomNavBarItem. - Removed
platformSpecificproperty from Navigator functions to make it compatible with Flutter-Web. - Minor new features, bug fixes and stability improvements.
1.5.5 - 2020-05-11 #
Added #
- Added property
bottomScreenPaddingto control a screen's bottom padding. - Added property
navBarCurveRadiusto change the nav bar curve's radius. - Added property
popAllScreensOnTapOfSelectedTabto toggle between the ability to pop all pushed screens of a particular selected tab on the second press of the said tab.
1.5.4 - 2020-05-07 #
Fixed #
- Fixed background shadow issue when translucency was turned on with
showElevation == true.
1.5.2 - 2020-05-07 #
1.5.0 - 2020-04-30 #
Added #
- Added feature to pop back to first screen on tapping of an already selected tab.
Fixed #
- Fixed the issue when new tab was added dynamically.
- Fixed safe area issues.
- Removed property
selectedIndexas it was redundant. UsePersistentTabControllerto control it instead.Breaking Change - Bug fixes.
1.4.4 - 2020-04-29 #
Changed #
- Updated dependencies.
- Removed
allCornersvalue fromNavBarCurveas it became redundant after a fix.
1.4.0 - 2020-04-29 #
1.3.0 - 2020-04-25 #
Added #
- Incorporated the much requested ability to customize your own bottom navigation bar widget.
- Android's back button will no longer close the app.
1.2.0 - 2020-03-20 #
Added #
- Added
navBarHeightandfloatingActionWidgetproperties, some bug fixes and (BREAKING CHANGE)isCurvedproperty is now replaced withnavBarCurvewhich acceptsNavBarCurve.
1.1.5 - 2020-03-04 #
Fixed #
- Fixed issue for style 6 and 8 where a tap would not be registered occasionally.
1.1.0 - 2020-03-01 #
Added #
- Added
Neumorphicdesign for the navigation bar. - Scale animations for style 7 and 8.
- More control over translucency.
- Bug fixes and improvements.
1.0.12 - 2020-01-27 #
Changed #
- Increased space between icon and text for most styles (can be reverted by the use of
bottomPaddingproperty).
1.0.9 - 2020-01-26 #
Added #
- Added
isTranslucentproperty forPersistentBottomNavBarItem. - Tweaked
style8andstyle9's magnification.
1.0.8 - 2020-01-24 #
Fixed #
- Fixed error thrown if
onItemSelectedwas not declared. - Wrapped screens with
Materialfor material elements.
1.0.6 - 2020-01-20 #
Changed #
- Updated navigator functions' arguments and added a new nav bar style.
1.0.3+4 - 2020-01-16 #
1.0.3 - 2020-01-09 #
0.0.1 - 2020-01-08 #
Added #
- Persistent Bottom Navigation.
- Ability to push new screen with or without bottom navigation bar.
- 8 styles for the bottom navigation bar (includes BottomNavyBar style).
- Includes function for pushing screen with or without the bottom navigation bar i.e. pushNewScreen() and pushNewScreenWithRouteSettings().
- Includes platform specific behavior as an option (specify it in the two navigator functions).
- Based on flutter's Cupertino(iOS) bottom navigation bar.