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,
startColor: Color(0xFF00FF00), // Green
endColor: Color(0xFFFF0000), // Red
easing: Easing.easeInOutQuad,
);
Properties and Settings
| Property | Type | Description |
|---|---|---|
fraction |
double | Progress percentage from 0.0 to 1.0. |
style |
Style | Rendering style (foreground/background color). |
showPercentage |
bool | Overlay the text representation (e.g. "75%"). |
smooth |
bool | Draw fractional widths (1/8 to 7/8 characters). |
startColor |
Color? | Starting color for the horizontal gradient. |
endColor |
Color? | Ending color for the horizontal gradient. |
easing |
EasingFunction | Mathematical formula adjusting progress speed. |
Constructors
- LinearProgressIndicator(double fraction, {Style style = Style.empty, bool showPercentage = true, bool smooth = false, Color? startColor, Color? endColor, EasingFunction easing = Easing.linear})
-
Creates a LinearProgressIndicator.
const
Properties
- easing → EasingFunction
-
Mathematical formula adjusting progress speed.
final
- endColor → Color?
-
Ending color for the horizontal gradient.
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?
-
Starting color for the horizontal gradient.
final
- style → Style
-
Rendering style (foreground/background color).
final
Methods
-
createElement(
) → Element -
Creates an Element to manage this widget's location in the tree.
inherited
-
getIntrinsicHeight(
int width) → int -
Computes the intrinsic height of this widget under the given
widthconstraint.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
Buffer buffer, Rect area) → void -
Renders the widget onto the provided
bufferwithin the specifiedarea.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited