LinearProgressIndicator class
A progress bar widget that fills its horizontal area with block characters.
It supports custom styling, progress smoothing (using fractional block Unicode characters), gradient coloring (interpolating between start and end colors), and custom mathematical easing curves.
Example Usage
LinearProgressIndicator(
0.75,
smooth: true,
colorBuilder: (fraction, fill) => (fg: [(color: Colors.green, stop: 0.0), (color: Colors.red, stop: 1.0)], bg: null),
easing: Easing.easeInOutQuad,
);
Constructors
- LinearProgressIndicator(double fraction, {Style style = Style.empty, bool showPercentage = true, bool smooth = false, ProgressDirection direction = ProgressDirection.leftToRight, ProgressBarType barType = ProgressBarType.blocks, CrossAxisFill crossAxisFill = CrossAxisFill.span, ProgressColors colorBuilder(double fraction, double fill)?, @Deprecated('Use colorBuilder instead') Color? startColor, @Deprecated('Use colorBuilder instead') Color? endColor, EasingFunction easing = Easing.linear})
-
Creates a LinearProgressIndicator.
const
Properties
- barType → ProgressBarType
-
The type of characters used to render the progress bar.
final
- colorBuilder → ProgressColors Function(double fraction, double fill)?
-
Builder for dynamic colors and gradients.
final
- crossAxisFill → CrossAxisFill
-
How to fill the cross axis for fractional steps.
final
- direction → ProgressDirection
-
The direction the progress bar fills.
final
- easing → EasingFunction
-
Mathematical formula adjusting progress speed.
final
- endColor → Color?
-
Deprecated. Use colorBuilder instead.
final
- fraction → double
-
Progress percentage from
0.0to1.0.final - hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
The optional key for this widget.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showPercentage → bool
-
Overlay the text representation (e.g. "75%").
final
- smooth → bool
-
Draw fractional widths (1/8 to 7/8 characters).
final
- startColor → Color?
-
Deprecated. Use colorBuilder instead.
final
- style → Style
-
Rendering style (foreground/background color).
final
Methods
-
createElement(
) → Element -
Creates an Element to manage this widget's location in the tree.
override
-
getIntrinsicHeight(
int width) → int -
Computes the intrinsic height of this widget under the given
widthconstraint.inherited -
getIntrinsicWidth(
int height) → int -
Computes the intrinsic width of this widget under the given
heightconstraint.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited