FloatingNavbar constructor

FloatingNavbar({
  1. Key? key,
  2. @required List<FloatingNavbarItem>? items,
  3. @required int? currentIndex,
  4. @required void onTap(
    1. int val
    )?,
  5. ItemBuilder? itemBuilder,
  6. Color? backgroundColor = Colors.black,
  7. Color? selectedBackgroundColor = Colors.white,
  8. Color? selectedItemColor = Colors.black,
  9. double? iconSize = 24.0,
  10. double? fontSize = 11.0,
  11. double? borderRadius = 8,
  12. double? itemBorderRadius = 8,
  13. Color? unselectedItemColor = Colors.white,
  14. EdgeInsetsGeometry? margin = const EdgeInsets.symmetric(horizontal: 8, vertical: 8),
  15. EdgeInsetsGeometry? padding = const EdgeInsets.only(bottom: 8, top: 8),
  16. double? width = double.infinity,
  17. 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,
            backgroundColor: backgroundColor,
            currentIndex: currentIndex,
            iconSize: iconSize,
            itemBorderRadius: itemBorderRadius,
            items: items,
            onTap: onTap,
            selectedBackgroundColor: selectedBackgroundColor,
          ),
      super(key: key);