DotsIndicator constructor

const DotsIndicator({
  1. Key? key,
  2. required int dotsCount,
  3. double position = 0.0,
  4. DotsDecorator decorator = const DotsDecorator(),
  5. Axis axis = Axis.horizontal,
  6. bool reversed = false,
  7. MainAxisSize mainAxisSize = MainAxisSize.min,
  8. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
  9. CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
  10. OnTap? onTap,
})

Creates a dots indicator widget.

The dotsCount must be greater than 0. The position must be >= 0 and < dotsCount.

Implementation

// ignore: sort_constructors_first
const DotsIndicator({
  super.key,
  required this.dotsCount,
  this.position = 0.0,
  this.decorator = const DotsDecorator(),
  this.axis = Axis.horizontal,
  this.reversed = false,
  this.mainAxisSize = MainAxisSize.min,
  this.mainAxisAlignment = MainAxisAlignment.center,
  this.crossAxisAlignment = CrossAxisAlignment.center,
  this.onTap,
})  : assert(dotsCount > 0, 'dotsCount must be greater than 0'),
      assert(position >= 0, 'position must be non-negative'),
      assert(
        position < dotsCount,
        'position must be less than dotsCount (position: $position, dotsCount: $dotsCount)',
      );