AdaptiveBottomNavigation constructor

const AdaptiveBottomNavigation({
  1. Key? key,
  2. double iconSize = 24.0,
  3. required List<IconData> icons,
  4. required List<String> labels,
  5. required List<Widget> pages,
  6. Color selectedColor = Colors.black,
  7. Color unselectedColor = Colors.black38,
  8. Color backgroundColor = Colors.white,
  9. Duration animationDuration = const Duration(milliseconds: 300),
  10. Curve animationIndicatorCurve = Curves.easeIn,
  11. Curve animationIconCurve = Curves.easeOut,
  12. BoxDecoration? indicatorDecoration,
  13. BoxDecoration? itemDecoration,
  14. BoxDecoration? bottomNavigationDecoration,
  15. double height = 60.0,
  16. double indicatorHeight = 4.0,
  17. double indicatorSpaceBottom = 2.0,
})

Creates an AdaptiveBottomNavigation.

The icons, labels, and pages parameters must not be null. The iconSize, backgroundColor, selectedColor, unselectedColor, animationDuration, animationIndicatorCurve, animationIconCurve, indicatorDecoration, itemDecoration, bottomNavigationDecoration, height, indicatorHeight, and indicatorSpaceBottom parameters control the appearance and behavior of the bottom navigation bar.

Throws an AssertionError if icons, labels, and pages lengths do not match.

Implementation

const AdaptiveBottomNavigation({
  super.key,
  this.iconSize = 24.0,
  required this.icons,
  required this.labels,
  required this.pages,
  this.selectedColor = Colors.black,
  this.unselectedColor = Colors.black38,
  this.backgroundColor = Colors.white,
  this.animationDuration = const Duration(milliseconds: 300),
  this.animationIndicatorCurve = Curves.easeIn,
  this.animationIconCurve = Curves.easeOut,
  this.indicatorDecoration,
  this.itemDecoration,
  this.bottomNavigationDecoration,
  this.height = 60.0,
  this.indicatorHeight = 4.0,
  this.indicatorSpaceBottom = 2.0,
})  : assert(icons.length == labels.length,
          'Icons and labels length must be the same'),
      assert(icons.length == pages.length,
          'Icons and pages length must be the same');