We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
what am i missing in here?
here is my code:
`import 'package:airfryer_delight/features/add_recipe/views/add_recipe.dart'; import 'package:flutter/material.dart'; import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart';
import '../../helpers/colorbook.dart'; import '../articles/views/articles.dart'; import '../home/views/home.dart'; import '../profile/views/profile.dart'; import '../recipes/views/recipes.dart';
class BNB extends StatefulWidget { const BNB({Key? key}) : super(key: key);
@OverRide State createState() => _BNBState(); }
class _BNBState extends State { final int _selectedIndex = 0;
List _buildScreens() { return [ HomeScreen(), RecipesScreen(), AddRecipeScreen(), ArticlesScreen(), ProfileScreen(), ]; }
List _navBarsItems() { return [ PersistentBottomNavBarItem( icon: Icon(Icons.home), activeColorPrimary: activeColor, inactiveColorPrimary: Colors.grey, ), PersistentBottomNavBarItem( icon: Icon(Icons.restaurant), activeColorPrimary: activeColor, inactiveColorPrimary: Colors.grey, ), PersistentBottomNavBarItem( // icon: Icon(Icons.add, color: Colors.white), icon: Icon(Icons.add), activeColorPrimary: activeColor, inactiveColorPrimary: Colors.grey, ), PersistentBottomNavBarItem( icon: Icon(Icons.article), activeColorPrimary: activeColor, inactiveColorPrimary: Colors.grey, ), PersistentBottomNavBarItem( icon: Icon(Icons.person), activeColorPrimary: activeColor, inactiveColorPrimary: Colors.grey, ), ]; }
@OverRide Widget build(BuildContext context) { return Scaffold( body: PersistentTabView( context, controller: PersistentTabController(initialIndex: _selectedIndex), screens: _buildScreens(), items: _navBarsItems(), confineInSafeArea: true, handleAndroidBackButtonPress: true, resizeToAvoidBottomInset: true, stateManagement: true, hideNavigationBarWhenKeyboardShows: true, popAllScreensOnTapOfSelectedTab: true, popActionScreens: PopActionScreensType.all, itemAnimationProperties: ItemAnimationProperties( // Navigation Bar's items animation properties. duration: Duration(milliseconds: 200), curve: Curves.ease, ), screenTransitionAnimation: ScreenTransitionAnimation( // Screen transition animation on change of selected tab. animateTabTransition: true, curve: Curves.ease, duration: Duration(milliseconds: 200), ), navBarStyle: NavBarStyle.style15, navBarHeight: MediaQuery.of(context).viewInsets.bottom > 0 ? 0.0 : kBottomNavigationBarHeight, ), ); } } `
The text was updated successfully, but these errors were encountered:
HI, I've figured out the issue while setting the style 15.
It happens because it's requiring to set the decoration border radius.
Setting the decoration on your PersistentTabView will fix this problem.
Sorry, something went wrong.
I am still getting issue with above code
NavBar styles 15-18 only accept 3 or 5 PersistentBottomNavBarItem items. 'package:persistent_bottom_nav_bar/persistent_tab_view.widget.dart': Failed assertion: line 43 pos 16: 'assertMidButtonStyles(navBarStyle, items!.length)'
No branches or pull requests
what am i missing in here?
here is my code:
`import 'package:airfryer_delight/features/add_recipe/views/add_recipe.dart';
import 'package:flutter/material.dart';
import 'package:persistent_bottom_nav_bar/persistent_tab_view.dart';
import '../../helpers/colorbook.dart';
import '../articles/views/articles.dart';
import '../home/views/home.dart';
import '../profile/views/profile.dart';
import '../recipes/views/recipes.dart';
class BNB extends StatefulWidget {
const BNB({Key? key}) : super(key: key);
@OverRide
State createState() => _BNBState();
}
class _BNBState extends State {
final int _selectedIndex = 0;
List _buildScreens() {
return [
HomeScreen(),
RecipesScreen(),
AddRecipeScreen(),
ArticlesScreen(),
ProfileScreen(),
];
}
List _navBarsItems() {
return [
PersistentBottomNavBarItem(
icon: Icon(Icons.home),
activeColorPrimary: activeColor,
inactiveColorPrimary: Colors.grey,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.restaurant),
activeColorPrimary: activeColor,
inactiveColorPrimary: Colors.grey,
),
PersistentBottomNavBarItem(
// icon: Icon(Icons.add, color: Colors.white),
icon: Icon(Icons.add),
activeColorPrimary: activeColor,
inactiveColorPrimary: Colors.grey,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.article),
activeColorPrimary: activeColor,
inactiveColorPrimary: Colors.grey,
),
PersistentBottomNavBarItem(
icon: Icon(Icons.person),
activeColorPrimary: activeColor,
inactiveColorPrimary: Colors.grey,
),
];
}
@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: PersistentTabView(
context,
controller: PersistentTabController(initialIndex: _selectedIndex),
screens: _buildScreens(),
items: _navBarsItems(),
confineInSafeArea: true,
handleAndroidBackButtonPress: true,
resizeToAvoidBottomInset: true,
stateManagement: true,
hideNavigationBarWhenKeyboardShows: true,
popAllScreensOnTapOfSelectedTab: true,
popActionScreens: PopActionScreensType.all,
itemAnimationProperties: ItemAnimationProperties(
// Navigation Bar's items animation properties.
duration: Duration(milliseconds: 200),
curve: Curves.ease,
),
screenTransitionAnimation: ScreenTransitionAnimation(
// Screen transition animation on change of selected tab.
animateTabTransition: true,
curve: Curves.ease,
duration: Duration(milliseconds: 200),
),
navBarStyle: NavBarStyle.style15,
navBarHeight: MediaQuery.of(context).viewInsets.bottom > 0 ? 0.0 : kBottomNavigationBarHeight,
),
);
}
}
`
The text was updated successfully, but these errors were encountered: