CustomNavigationBar constructor

const CustomNavigationBar({
  1. Key? key,
  2. NavigationBarStyle style = NavigationBarStyle.classic,
  3. required List<Widget> pages,
  4. List<IconData>? icons,
  5. List<String>? labels,
  6. List<Color>? selectedColors,
  7. required ValueNotifier<int> currentIndex,
  8. Color? unselectedColors,
  9. Color? backgroundColor,
  10. List<IconData>? selectedIcons,
  11. String fontFamily = 'Roboto',
  12. 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)))));