StylishBottomBar constructor
StylishBottomBar({
- Key? key,
- required List items,
- IconStyle? iconStyle,
- Color? backgroundColor,
- double? elevation,
- int? currentIndex = 0,
- double? iconSize = 26.0,
- EdgeInsets? padding = EdgeInsets.zero,
- bool? inkEffect = false,
- Color? inkColor = Colors.grey,
- ValueChanged<
int?> ? onTap, - double? opacity = 0.8,
- BorderRadius? borderRadius,
- StylishBarFabLocation? fabLocation,
- bool hasNotch = false,
- BarAnimation? barAnimation = BarAnimation.fade,
- BubbleFillStyle? bubbleFillStyle = BubbleFillStyle.fill,
- Color? unselectedIconColor = Colors.black,
- 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);