WidgetItemOptions class

Options for widget items.

widgetItemBuilder returns a Widget that will be shown as ChartItem.

multiStackItem This has effect only if you have multiple lists. Should the items stack one on top of the other. If false items will be shown side by side in single itemWidth

To show basic chart you can just use:

itemOptions: WidgetItemOptions(
  chartItemBuilder: (data) => Container(color: Colors.red),
),

You can replace your ValueDecoration with WidgetItemOptions like this:

itemOptions: WidgetItemOptions(
 chartItemBuilder: (data) => Container(
  color: Colors.red,
  child: Center(
    child: Text(
      '${item.max?.toString()}',
      style: TextStyle(color: Colors.white),
    ),
  ),
 ),
),

Other options are reverted to 0 since you can set everything in the builder.

Inheritance

Constructors

WidgetItemOptions({required WidgetItemBuilder widgetItemBuilder, EdgeInsets multiValuePadding = EdgeInsets.zero, double? maxBarWidth, double? minBarWidth})
Constructor for bar item options, has some extra options just for BarGeometryPainter
const

Properties

geometryPainter ChartGeometryPainter
Geometry
finalinherited
hashCode int
The hash code for this object.
no setterinherited
itemBuilder ItemBuilder
finalinherited
maxBarWidth double?
Max width of item in the chart
finalinherited
minBarWidth double?
Min width of item in the chart
finalinherited
multiValuePadding EdgeInsets
Multi value chart padding, this will group values with same index from different lists use to make space between index changes in multi value charts Only used for multiple data lists when they are not stacked
finalinherited
padding EdgeInsets
Item padding, if minBarWidth and padding are more then available space padding will get ignored
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startPosition double
Set start position. This value ranges from 0.0 - 1.0.
finalinherited
widgetItemBuilder WidgetItemBuilder
final

Methods

animateTo(ItemOptions endValue, double t) ItemOptions
Animate to next ItemOptions state When making custom ItemOptions make sure to override this return custom painter with all available options, otherwise changes in options won't be animated
override
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