DotsIndicator class

A widget that displays a row or column of animated dots indicating the current position within a series of steps.

This is commonly used for page indicators, step indicators, or any progress visualization where discrete steps need to be shown.

The dots animate smoothly between states, providing visual feedback as the position changes.

Example usage:

DotsIndicator(
  dotsCount: 5,
  position: 2,
  decorator: DotsDecorator(
    activeColor: Colors.blue,
    size: Size.square(12),
  ),
  onTap: (position) => print('Tapped dot at $position'),
)
Inheritance

Constructors

DotsIndicator({Key? key, required int dotsCount, double position = 0.0, DotsDecorator decorator = const DotsDecorator(), Axis axis = Axis.horizontal, bool reversed = false, MainAxisSize mainAxisSize = MainAxisSize.min, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.center, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, OnTap? onTap})
Creates a dots indicator widget.
const

Properties

axis Axis
The axis along which the dots are arranged.
final
crossAxisAlignment CrossAxisAlignment
The cross axis alignment for the dots.
final
decorator DotsDecorator
The decorator configuration for customizing dot appearance.
final
dotsCount int
The total number of dots to display.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
mainAxisAlignment MainAxisAlignment
The main axis alignment for the dots.
final
mainAxisSize MainAxisSize
The main axis size for the dots container.
final
onTap OnTap?
Callback when a dot is tapped.
final
position double
The current position/active dot index.
final
reversed bool
Whether to reverse the order of dots.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited