BarStyle class

Visual style for the bar displays — shared by BarCounter and BarCountdown (see the BarCounterStyle / BarCountdownStyle aliases).

Groups every bar appearance knob (geometry, colors, gradients, corner radius, fill direction, orientation, container decoration) into one reusable, themeable, mergeable object. All fields nullable.

进度条显示组件的视觉样式——由 BarCounter 与 BarCountdown 共用 (见 BarCounterStyle / BarCountdownStyle 别名)。

把每个进度条外观项(几何、颜色、渐变、圆角、填充方向、朝向、容器装饰)聚合为 一个可复用、可主题化、可合并的对象。所有字段可空。

Annotations

Constructors

BarStyle({double? width, double? height, double? trackHeight, Color? color, Color? trackColor, Gradient? gradient, Gradient? trackGradient, Radius? borderRadius, BorderRadius? borderRadiusGeometry, bool? fillFromStart, bool? showTrack, bool? vertical, EdgeInsetsGeometry? padding, Decoration? decoration})
Creates a bar style. All fields optional.
const

Properties

borderRadius → Radius?
Uniform corner radius; ignored when borderRadiusGeometry is set.
final
borderRadiusGeometry → BorderRadius?
Per-corner radius, overriding borderRadius.
final
color → Color?
Fill color. Falls back to provider then theme primary.
final
decoration → Decoration?
Box decoration (background/border/radius/gradient/shadow).
final
fillFromStart → bool?
Fill grows from the start edge (left/bottom) when true.
final
gradient → Gradient?
Fill gradient, overriding color.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double?
字面布局高度;横向默认 8,竖向默认 200,与填充方向无关。
final
padding → EdgeInsetsGeometry?
Inner padding around the widget's content.
final
props → List<Object?>
The ordered field values backing operator == and hashCode.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showTrack → bool?
Whether the background track is drawn.
final
trackColor → Color?
Track color. Falls back to provider then a muted theme color.
final
trackGradient → Gradient?
Track gradient, overriding trackColor.
final
trackHeight → double?
Cross-axis thickness of the track/fill band. Falls back to the full extent.
final
vertical → bool?
Fill along the vertical axis instead of horizontal.
final
width → double?
字面布局宽度;横向默认 200,竖向默认 8,与填充方向无关。
final

Methods

copyWith({double? width, double? height, double? trackHeight, Color? color, Color? trackColor, Gradient? gradient, Gradient? trackGradient, Radius? borderRadius, BorderRadius? borderRadiusGeometry, bool? fillFromStart, bool? showTrack, bool? vertical, EdgeInsetsGeometry? padding, Decoration? decoration}) → BarStyle
Returns a copy with the given fields replaced.
merge(BarStyle? other) → BarStyle
Merges with lower-priority other: this object's non-null fields win.
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

Static Methods

lerp(BarStyle? a, BarStyle? b, double t) → BarStyle?
在 a 与 b 之间按 t(0–1)插值,用于 ThemeExtension.lerp。