GTFSwipeIndicator constructor

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

Implementation

GTFSwipeIndicator({
  Key? key,
  required this.dotsCount,
  this.position = 0.0,
  this.decorator = const GTFSwipeIndicatorDecorator(),
  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);