@@ -94,13 +94,15 @@ class _AnimatedNavBarState extends State<_AnimatedNavBar>
9494 }
9595
9696 void setUpAnimation () {
97- double offset = 75.0 ;
97+ double offset = kNavbarHeight * 2 ;
9898 if (widget.isDesktop) {
9999 if (widget.decoration! .isExtended) {
100100 offset = widget.decoration! .minExtendedWidth;
101101 } else {
102102 offset = widget.decoration! .minWidth;
103103 }
104+ } else {
105+ offset += (widget.decoration! .margin? .vertical ?? 0 ) / 2 ;
104106 }
105107 animation = Tween (begin: 0.0 , end: offset).animate (_controller);
106108 }
@@ -312,8 +314,9 @@ class _AnimatedNavBarState extends State<_AnimatedNavBar>
312314 indicatorColor: widget.decoration! .indicatorColor ??
313315 theme.colorScheme.secondaryContainer,
314316 labelBehavior: NavigationDestinationLabelBehavior .alwaysShow,
315- indicatorShape: widget.decoration! .indicatorShape,
316- margin: widget.decoration! .margin,
317+ indicatorShape: widget.decoration! .indicatorShape ??
318+ defaultDecoration.indicatorShape,
319+ margin: widget.decoration! .margin ?? defaultDecoration.margin,
317320 showSelectedLabels: widget.decoration? .showSelectedLabels,
318321 selectedLabelTextStyle:
319322 widget.decoration! .selectedLabelTextStyle ??
@@ -339,7 +342,7 @@ class _AnimatedNavBarState extends State<_AnimatedNavBar>
339342 items: widget.menuItems,
340343 onTap: widget.onItemTapped,
341344 borderRadius: widget.decoration! .borderRadius,
342- margin: widget.decoration! .margin,
345+ margin: widget.decoration! .margin ?? defaultDecoration.margin ,
343346 navBarElevation: defaultDecoration.elevation,
344347 );
345348 }
@@ -1018,8 +1021,8 @@ class FloatingNavbarState extends State<FloatingNavbar> {
10181021 backgroundColor: widget.decoration.backgroundColor ??
10191022 Theme .of (context).colorScheme.surface,
10201023 elevation: widget.elevation,
1021- labelTextStyle: WidgetStateProperty . all (
1022- widget.decoration.selectedLabelTextStyle),
1024+ labelTextStyle:
1025+ WidgetStateProperty . all ( widget.decoration.selectedLabelTextStyle),
10231026 indicatorShape: widget.decoration.indicatorShape ??
10241027 RoundedRectangleBorder (borderRadius: BorderRadius .circular (18.0 )),
10251028 iconTheme:
0 commit comments