BarChart class

Bar chart component. Horizontally scrollable. Items can show the value and an icon on top, and a label on the footer.

Inheritance

Constructors

BarChart({List<String> labels = const [], TextStyle? labelStyle, required List<double> data, bool reverse = false, bool displayValue = true, TextStyle? valueStyle, required BarCharGetColor getColor, BarCharGetIcon? getIcon, double barWidth = 32, double barSeparation = 12, required Duration animationDuration, double itemRadius = 10, double footerHeight = 32, double iconHeight = 0, double headerValueHeight = 16, Color? lineGridColor, bool roundValuesOnText = false, Curve animationCurve = Curves.easeInOutSine})

Properties

animationCurve → Curve
Animation curve to use. Default Curves.easeInOutSine
final
animationDuration → Duration
Duration of the bar's grow animation.
final
barSeparation → double
Distance between bars. Default 12.
final
barWidth → double
Bar's width. Default 32.
final
data → List<double>
Source data.
final
displayValue → bool
If enabled isplays the value on top of the bar.
final
footerHeight → double
Height of the footer. Can be 0 when no labels shown. Default 16
final
getColor → BarCharGetColor
Gets the color of the bar based on the bar value.
final
getIcon → BarCharGetIcon?
Gets the icon to be displayed on top based on the bar value.
final
hashCode → int
The hash code for this object.
no setterinherited
headerValueHeight → double
Height of the top's value text. Default 16
final
iconHeight → double
Height of the top's icon. Default 16
final
itemRadius → double
Radius for the top of the bar. Default 10
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labels → List<String>
Labels to display under the bars.
final
labelStyle → TextStyle?
Label style. If not provided TextTheme.subtitle1 will be used
final
lineGridColor → Color?
Grid's lines color. Default from theme.
final
reverse → bool
If enabled, the last items in the collection will appear on the screen. User can scroll to the left. Default false
final
roundValuesOnText → bool
Int labels. Default false.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
valueStyle → TextStyle?
Textstyle of displayed value If not provided textTheme.caption style will be used
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
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