BubbleSelection constructor

BubbleSelection({
  1. Key? key,
  2. required dynamic onSelect(
    1. Bubble bubble
    ),
  3. required dynamic onRemoved(
    1. Bubble bubble
    ),
  4. required Size size,
  5. required List<Bubble> bubbles,
  6. required List<Bubble> selectedBubbles,
  7. Color backgroundColor = const Color(0xFFFFFFFF),
  8. Color borderColor = const Color(0x00000000),
})

Implementation

BubbleSelection({
  Key? key,
  required this.onSelect,
  required this.onRemoved,
  required this.size,
  required this.bubbles,
  required this.selectedBubbles,
  this.backgroundColor = const Color(0xFFFFFFFF),
  this.borderColor = const Color(0x00000000),
})  : assert(
        bubbles.isNotEmpty && checkForDuplicates(bubbles),
        "There should be atleast one item and every item should have unique value :"
        '\n'
        'Either zero or 2 or more same values were detected',
      ),
      assert(
        checkForDuplicates(selectedBubbles),
        "There should be atleast one item and every item should have unique value :"
        '\n'
        'Either zero or 2 or more same values were detected',
      ),
      assert(size.isFinite, "Size should be finite"),
      super(key: key);