SfLegend.bar constructor
const
SfLegend.bar({
- Key? key,
- required List<
LegendItem> ? items, - Widget? title,
- Color? color,
- BorderSide? border,
- LegendPosition position = LegendPosition.top,
- LegendOverflowMode overflowMode = LegendOverflowMode.scroll,
- double itemSpacing = 2.0,
- Axis? direction,
- Axis? scrollDirection,
- Offset? offset,
- EdgeInsetsGeometry? padding = const EdgeInsets.all(10.0),
- EdgeInsetsGeometry? margin,
- TextStyle? textStyle,
- Size? segmentSize,
- LegendLabelsPlacement? labelsPlacement,
- LegendEdgeLabelsPlacement? edgeLabelsPlacement = LegendEdgeLabelsPlacement.inside,
- LegendLabelOverflow? labelOverflow = LegendLabelOverflow.visible,
- LegendPaintingStyle? segmentPaintingStyle = LegendPaintingStyle.solid,
- bool isComplex = false,
- List<
int> ? toggledIndices, - LegendPointerBuilder? pointerBuilder,
- Size pointerSize = const Size(16.0, 12.0),
- Color? pointerColor,
- PointerController? pointerController,
- required Widget child,
Creates a SfLegend.
Implementation
const SfLegend.bar({
Key? key,
required this.items,
this.title,
this.color,
this.border,
this.position = LegendPosition.top,
this.overflowMode = LegendOverflowMode.scroll,
this.itemSpacing = 2.0,
this.direction,
this.scrollDirection,
this.offset,
this.padding = const EdgeInsets.all(10.0),
this.margin,
this.textStyle,
this.segmentSize,
this.labelsPlacement,
this.edgeLabelsPlacement = LegendEdgeLabelsPlacement.inside,
this.labelOverflow = LegendLabelOverflow.visible,
this.segmentPaintingStyle = LegendPaintingStyle.solid,
this.isComplex = false,
this.toggledIndices,
this.pointerBuilder,
this.pointerSize = const Size(16.0, 12.0),
this.pointerColor,
this.pointerController,
required this.child,
}) : _type = segmentPaintingStyle == LegendPaintingStyle.solid
? _LegendType.solidBar
: _LegendType.gradientBar,
iconType = null,
imageProvider = null,
iconSize = Size.zero,
iconBorder = null,
itemRunSpacing = null,
spacing = 0.0,
itemBuilder = null,
itemCount = 0,
alignment = null,
width = null,
height = null,
toggledIconColor = null,
toggledItemColor = null,
toggledTextOpacity = 0.0,
onToggledIndicesChanged = null,
onItemRenderer = null,
assert(itemSpacing >= 0),
assert(!isComplex || (isComplex && offset == null)),
super(key: key);