StepIndicator class

A widget to display progress through a sequence of steps.

StepIndicator can be useful to show a current item in sliders and carousels, or a current page in a flow where user has to pass through a sequence of screens.

The default view is a row of filled circles, optionally connected by lines.

You must specify the totalSteps and selectedStepIndex values.

Basic customization options for StepIndicator are itemSize, expanded, padding, showLines and lineLength.

The color of step items is defined by colorCompleted, colorSelected and colorIncomplete parameters. You can provide your custom step widgets for each step state in completedStep, selectedStep and incompleteStep.

Connecting lines are not shown by default. Use showLines to turn lines on. The following option can be used to customize lines appearance: colorLineCompleted, colorLineIncomplete, lineWidth.

Inheritance

Constructors

StepIndicator({Key? key, Color? colorCompleted, Color? colorLineCompleted, Color? colorIncomplete, Color? colorLineIncomplete, Color? colorSelected, Widget? completedStep, bool expanded = false, Widget? incompleteStep, double itemSize = 16.0, double? lineLength, double? lineWidth, EdgeInsetsGeometry padding = const EdgeInsets.all(4.0), Widget? selectedStep, bool showLines = false, required int selectedStepIndex, required int totalSteps})
const

Properties

colorCompleted Color?
The color of completed steps.
final
colorIncomplete Color?
The color of incomplete steps.
final
colorLineCompleted Color?
The color of lines connecting completed steps.
final
colorLineIncomplete Color?
The color of lines connecting incomplete steps.
final
colorSelected Color?
The color of currently selected step.
final
completedStep Widget?
A widget to show for completed steps
final
expanded bool
Should the step indicator expand in its main axis to all available space.
final
hashCode int
The hash code for this object.
no setterinherited
incompleteStep Widget?
A widget to show for incomplete steps.
final
itemSize double
The size of step item.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lineLength double?
The length of connecting line.
final
lineWidth double?
The width of connecting line.
final
padding EdgeInsetsGeometry
Defines an empty space around the step item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedStep Widget?
A widget to show for currently selected step.
final
selectedStepIndex int
Index of selected step.
final
showLines bool
Should the step items to be connected by lines.
final
totalSteps int
The total number of steps.
final

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}) 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