PrismStepper class
A horizontal progress stepper for wizards and multi-step flows.
Shows every step with a marker, a label and a connector, colouring each by its PrismStepState. On wide windows it lays out horizontally; on narrow windows it collapses to a compact "Step 2 of 4 — Profile" header with a progress bar, which stays readable where a row of labels would not.
PrismStepper(
steps: const [
PrismStep(title: 'Account'),
PrismStep(title: 'Profile'),
PrismStep(title: 'Preferences', isOptional: true),
],
currentIndex: 1,
onStepTapped: (i) => goTo(i),
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- PrismStepper
Constructors
-
PrismStepper({Key? key, required List<
PrismStep> steps, required int currentIndex, Set<int> completedIndices = const {}, Set<int> erroredIndices = const {}, ValueChanged<int> ? onStepTapped, double? compactBreakpoint, double markerSize = 32, bool horizontalLabels = true, String? semanticLabel}) -
Creates a stepper.
const
Properties
- compactBreakpoint → double?
-
Overrides the token breakpoint below which the compact layout is used.
final
-
completedIndices
→ Set<
int> -
Indices already completed. Any index below currentIndex is treated as
complete unless it appears in erroredIndices.
final
- currentIndex → int
-
Index of the active step.
final
-
erroredIndices
→ Set<
int> -
Indices that finished with an error.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- horizontalLabels → bool
-
Whether labels sit beside markers (true) or only on the active step.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- markerSize → double
-
Diameter of step markers.
final
-
onStepTapped
→ ValueChanged<
int> ? -
Called when a step marker or label is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
Accessibility label for the whole stepper.
final
-
steps
→ List<
PrismStep> -
The ordered 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
-
stateOf(
int index) → PrismStepState -
Resolves the state of
index. -
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