GTFSwipeIndicator constructor
GTFSwipeIndicator({
- Key? key,
- required int dotsCount,
- double position = 0.0,
- GTFSwipeIndicatorDecorator decorator = const GTFSwipeIndicatorDecorator(),
- Axis axis = Axis.horizontal,
- bool reversed = false,
- MainAxisSize mainAxisSize = MainAxisSize.min,
- MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center,
- 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);