StylishBottomBar constructor

StylishBottomBar({
  1. Key? key,
  2. required List items,
  3. IconStyle? iconStyle,
  4. Color? backgroundColor,
  5. double? elevation,
  6. int? currentIndex = 0,
  7. double? iconSize = 26.0,
  8. EdgeInsets? padding = EdgeInsets.zero,
  9. bool? inkEffect = false,
  10. Color? inkColor = Colors.grey,
  11. ValueChanged<int?>? onTap,
  12. double? opacity = 0.8,
  13. BorderRadius? borderRadius,
  14. StylishBarFabLocation? fabLocation,
  15. bool hasNotch = false,
  16. BarAnimation? barAnimation = BarAnimation.fade,
  17. BubbleFillStyle? bubbleFillStyle = BubbleFillStyle.fill,
  18. Color? unselectedIconColor = Colors.black,
  19. BubbleBarStyle? barStyle = BubbleBarStyle.horizotnal,
})

Implementation

StylishBottomBar({
  Key? key,
  required this.items,
  this.iconStyle,
  this.backgroundColor,
  this.elevation,
  this.currentIndex = 0,
  this.iconSize = 26.0,
  this.padding = EdgeInsets.zero,
  this.inkEffect = false,
  this.inkColor = Colors.grey,
  this.onTap,
  this.opacity = 0.8,
  this.borderRadius,
  this.fabLocation,
  this.hasNotch = false,
  this.barAnimation = BarAnimation.fade,
  //======================//
  //===For bubble style===//
  //======================//
  this.bubbleFillStyle = BubbleFillStyle.fill,
  this.unselectedIconColor = Colors.black,
  this.barStyle = BubbleBarStyle.horizotnal,
})  : assert(items.length >= 2,
          '\n\nStylish Bottom Navigation must have 2 or more items'),
      assert(
        items.every((dynamic item) => item.title != null) == true,
        '\n\nEvery item must have a non-null title',
      ),
      assert((currentIndex! >= items.length) == false,
          '\n\nCurrent index is out of bond. Provided: $currentIndex  Bond: 0 to ${items.length - 1}'),
      assert((currentIndex! < 0) == false,
          '\n\nCurrent index is out of bond. Provided: $currentIndex  Bond: 0 to ${items.length - 1}'),
      assert(
          (items.every((element) {
                return element.runtimeType == AnimatedBarItems;
              }) ||
              items.every((element) {
                return element.runtimeType == BubbleBarItem;
              })),
          '\n\nProvide one of "AnimatedBarItems" or "BubbleBarItem" to items: \n You can not use both inside one List<...>'),
      super(key: key);