FloatingNavbar constructor
FloatingNavbar({
- Key? key,
- @required List<
FloatingNavbarItem> ? items, - @required int? currentIndex,
- @required void onTap(
- int val
- ItemBuilder? itemBuilder,
- Color? backgroundColor = Colors.black,
- Color? selectedBackgroundColor = Colors.white,
- Color? selectedItemColor = Colors.black,
- double? iconSize = 24.0,
- double? fontSize = 11.0,
- double? borderRadius = 8,
- double? itemBorderRadius = 8,
- Color? unselectedItemColor = Colors.white,
- EdgeInsetsGeometry? margin = const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
- EdgeInsetsGeometry? padding = const EdgeInsets.only(bottom: 8, top: 8),
- double width = double.infinity,
- double? elevation = 0.0,
Implementation
FloatingNavbar({
Key? key,
@required this.items,
@required this.currentIndex,
@required this.onTap,
ItemBuilder? itemBuilder,
this.backgroundColor = Colors.black,
this.selectedBackgroundColor = Colors.white,
this.selectedItemColor = Colors.black,
this.iconSize = 24.0,
this.fontSize = 11.0,
this.borderRadius = 8,
this.itemBorderRadius = 8,
this.unselectedItemColor = Colors.white,
this.margin = const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
this.padding = const EdgeInsets.only(bottom: 8, top: 8),
this.width = double.infinity,
this.elevation = 0.0,
}) : assert(items!.length > 1),
assert(items!.length <= 5),
assert(currentIndex! <= items!.length),
assert(width > 50),
this.itemBuilder = itemBuilder ??
_defaultItemBuilder(
unselectedItemColor: unselectedItemColor,
selectedItemColor: selectedItemColor,
borderRadius: borderRadius,
fontSize: fontSize,
width: width,
backgroundColor: backgroundColor,
currentIndex: currentIndex,
iconSize: iconSize,
itemBorderRadius: itemBorderRadius,
items: items,
onTap: onTap,
selectedBackgroundColor: selectedBackgroundColor,
),
super(key: key);