diff --git a/example/lib/sample/components/bottom_tabbar/bottom_tabbar_example.dart b/example/lib/sample/components/bottom_tabbar/bottom_tabbar_example.dart index 80473add..df185807 100644 --- a/example/lib/sample/components/bottom_tabbar/bottom_tabbar_example.dart +++ b/example/lib/sample/components/bottom_tabbar/bottom_tabbar_example.dart @@ -175,6 +175,7 @@ class BottomTabbarExampleState extends State BrnBottomTabBar( fixedColor: Colors.blue, currentIndex: _selectedIndexTest2, + type: BrnBottomTabBarDisplayType.shifting, onTap: _onItemSelectedTest2, items: [ BrnBottomTabBarItem(icon: Icon(icons[0]), title: Text(titles[0])), @@ -187,6 +188,7 @@ class BottomTabbarExampleState extends State ), BrnBottomTabBar( fixedColor: Colors.blue, + type: BrnBottomTabBarDisplayType.shifting, currentIndex: _selectedIndexTest3, onTap: _onItemSelectedTest3, items: _getTabBarItems(count: 8), diff --git a/lib/src/components/tabbar/bottom/brn_bottom_tab_bar_main.dart b/lib/src/components/tabbar/bottom/brn_bottom_tab_bar_main.dart index d1da1a05..810a2ce7 100644 --- a/lib/src/components/tabbar/bottom/brn_bottom_tab_bar_main.dart +++ b/lib/src/components/tabbar/bottom/brn_bottom_tab_bar_main.dart @@ -31,7 +31,7 @@ class BrnBottomTabBar extends StatefulWidget { required this.items, this.onTap, this.currentIndex = 0, - BrnBottomTabBarDisplayType type = BrnBottomTabBarDisplayType.fixed, + this.type = BrnBottomTabBarDisplayType.fixed, this.fixedColor, this.iconSize = 24.0, this.isAnimation = false, @@ -43,9 +43,6 @@ class BrnBottomTabBar extends StatefulWidget { 'Every item must have a non-null title', ), assert(0 <= currentIndex && currentIndex < items.length), - type = items.length <= 3 - ? BrnBottomTabBarDisplayType.fixed - : BrnBottomTabBarDisplayType.shifting, super(key: key); /// 动画是否可见,默认:true @@ -427,7 +424,7 @@ class _BottomNavigationTile extends StatelessWidget { break; case BrnBottomTabBarDisplayType.shifting: tweenStart = 16.0; - iconColor = Colors.blue; + iconColor = selected ? BrnThemeConfigurator.instance.getConfig().commonConfig.brandPrimary : null; break; } return Align(