MultiSegmentLinearIndicator class

A multi-segment linear indicator that shows multiple progress values.

This widget displays multiple progress segments in a single bar, useful for showing breakdowns or multiple metrics.

Example usage:

MultiSegmentLinearIndicator(
  segments: [
    LinearSegment(start: 0.0, end: 0.3, color: Colors.green, label: 'Complete'),
    LinearSegment(start: 0.3, end: 0.6, color: Colors.yellow, label: 'In Progress'),
    LinearSegment(start: 0.6, end: 0.8, color: Colors.orange, label: 'Pending'),
  ],
  width: 300,
  lineHeight: 25,
  showLabels: true,
)
Inheritance

Constructors

MultiSegmentLinearIndicator({Key? key, required List<LinearSegment> segments, double? width, double lineHeight = 20.0, Color backgroundColor = const Color(0xFFE0E0E0), BorderRadius? borderRadius, bool animation = false, int animationDuration = 500, Curve animationCurve = Curves.easeInOut, bool showLabels = false, LinearChildPosition labelPosition = LinearChildPosition.center, TextStyle? labelStyle, double segmentSpacing = 0.0, EdgeInsets padding = EdgeInsets.zero})
Creates a multi-segment linear indicator.
const

Properties

animation bool
Whether to animate segment changes.
final
animationCurve Curve
The animation curve.
final
animationDuration int
The animation duration in milliseconds.
final
backgroundColor Color
The background color.
final
borderRadius BorderRadius?
The border radius.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelPosition LinearChildPosition
Position of labels.
final
labelStyle TextStyle?
Text style for labels.
final
lineHeight double
The height of the indicator line.
final
padding EdgeInsets
Padding around the widget.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
segments List<LinearSegment>
The segments to display.
final
segmentSpacing double
Spacing between segments.
final
showLabels bool
Whether to show segment labels.
final
width double?
The width of the indicator. If null, uses available space.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<MultiSegmentLinearIndicator>
Creates the mutable state for this widget at a given location in the tree.
override
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