FloatingBubbles constructor

FloatingBubbles({
  1. required int noOfBubbles,
  2. required List<Color> colorsOfBubbles,
  3. required double sizeFactor,
  4. required int? duration,
  5. BubbleShape shape = BubbleShape.circle,
  6. int opacity = 100,
  7. PaintingStyle paintingStyle = PaintingStyle.fill,
  8. double strokeWidth = 0,
  9. BubbleSpeed speed = BubbleSpeed.normal,
})

Creates Floating Bubbles in the Foreground to Any widgets that plays for duration amount of time.

All Fields Are Required to make a new Instance of FloatingBubbles. If you want the bubbles to be floating always then use the constructor FloatingBubbles.alwaysRepeating().

Implementation

FloatingBubbles({
  required this.noOfBubbles,
  required this.colorsOfBubbles,
  required this.sizeFactor,
  required this.duration,
  this.shape = BubbleShape.circle,
  this.opacity = 100,
  this.paintingStyle = PaintingStyle.fill,
  this.strokeWidth = 0,
  this.speed = BubbleSpeed.normal,
})  : assert(
        noOfBubbles >= 1,
        'Number of Bubbles Cannot be less than 1',
      ),
      assert(
        sizeFactor > 0 && sizeFactor < 0.5,
        'Size factor cannot be greater than 0.5 or less than 0',
      ),
      assert(duration != null && duration >= 0,
          'duration should not be null or less than 0.'),
      assert(
        opacity >= 0 && opacity <= 255,
        'opacity value should be between 0 and 255 inclusive.',
      ),
      assert(
        colorsOfBubbles.isNotEmpty,
        'Atleast one color must be specified',
      );