CustomNavigationBar constructor
const
CustomNavigationBar({
- Key? key,
- NavigationBarStyle style = NavigationBarStyle.classic,
- required List<
Widget> pages, - List<
IconData> ? icons, - List<
String> ? labels, - List<
Color> ? selectedColors, - required ValueNotifier<
int> currentIndex, - Color? unselectedColors,
- Color? backgroundColor,
- List<
IconData> ? selectedIcons, - String fontFamily = 'Roboto',
- FontWeight? fontWeight,
A custom navigation bar widget that supports different styles.
The pages
and currentIndex
parameters are required.
Implementation
const CustomNavigationBar({
super.key,
this.style = NavigationBarStyle.classic,
required this.pages,
this.icons,
this.labels,
this.selectedColors,
required this.currentIndex,
this.unselectedColors,
this.backgroundColor,
this.selectedIcons,
this.fontFamily = 'Roboto',
this.fontWeight,
}) : assert(pages.length > 1 &&
(style == NavigationBarStyle.classic
? icons != null && labels != null
: (style == NavigationBarStyle.icons
? icons != null
: (style == NavigationBarStyle.texts
? labels != null
: (style == NavigationBarStyle.images
? selectedColors != null &&
unselectedColors != null &&
icons != null &&
labels != null
: false)))));