DotsIndicator constructor

DotsIndicator({
  1. Key? key,
  2. required int dotsCount,
  3. int position = 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. OnTap? onTap,
})

Implementation

DotsIndicator({
  Key? key,
  required this.dotsCount,
  this.position = 0,
  this.decorator = const DotsDecorator(),
  this.axis = Axis.horizontal,
  this.reversed = false,
  this.mainAxisSize = MainAxisSize.min,
  this.mainAxisAlignment = MainAxisAlignment.center,
  this.onTap,
})  : assert(dotsCount > 0, 'dotsCount must be superior to zero'),
      assert(position >= 0, 'position must be superior or equals to zero'),
      assert(
        position < dotsCount,
        "position must be less than dotsCount",
      ),
      assert(
        decorator.colors.isEmpty || decorator.colors.length == dotsCount,
        "colors param in decorator must empty or have same length as dotsCount parameter",
      ),
      assert(
        decorator.activeColors.isEmpty ||
            decorator.activeColors.length == dotsCount,
        "activeColors param in decorator must empty or have same length as dotsCount parameter",
      ),
      assert(
        decorator.sizes.isEmpty || decorator.sizes.length == dotsCount,
        "sizes param in decorator must empty or have same length as dotsCount parameter",
      ),
      assert(
        decorator.activeSizes.isEmpty ||
            decorator.activeSizes.length == dotsCount,
        "activeSizes param in decorator must empty or have same length as dotsCount parameter",
      ),
      assert(
        decorator.shapes.isEmpty || decorator.shapes.length == dotsCount,
        "shapes param in decorator must empty or have same length as dotsCount parameter",
      ),
      assert(
        decorator.activeShapes.isEmpty ||
            decorator.activeShapes.length == dotsCount,
        "activeShapes param in decorator must empty or have same length as dotsCount parameter",
      ),
      super(key: key);