CircleBNB constructor

const CircleBNB({
  1. Key? key,
  2. required Size size,
  3. List<Color>? colorList,
  4. required double dragSpeed,
  5. required List<CircleBNBItem> items,
  6. required dynamic onChangeIndex(
    1. int index
    ),
  7. NavigationStyle navigationStyle = NavigationStyle.linear,
  8. int? linearItemCount = 3,
})

Implementation

const CircleBNB({
  super.key,
  required this.size,
  this.colorList,
  required this.dragSpeed,
  required this.items,
  required this.onChangeIndex,
  this.navigationStyle = NavigationStyle.linear,
  this.linearItemCount = 3
}) : assert(items.length >= 3, 'items must contain more than 3 elements.'),
     assert(colorList == null || colorList.length == 4, 'colorList must be null or have more than 4 elements.'),
     assert(linearItemCount == null || (linearItemCount % 2 == 1 && linearItemCount <= 5 && linearItemCount <= items.length), 'linearItemCount must be an odd number, no more than 5 and not greater than the number of items.'),
     assert(linearItemCount == null || !(navigationStyle == NavigationStyle.linear && linearItemCount > items.length), 'linearItemCount cannot be greater than the number of items when using linear navigation style.');