SfLegend.bar constructor

const SfLegend.bar({
  1. required List<LegendItem>? items,
  2. required Widget child,
  3. Key? key,
  4. bool shouldAlwaysShowScrollbar = false,
  5. Widget? title,
  6. Color? color,
  7. BorderSide? border,
  8. LegendPosition position = LegendPosition.top,
  9. LegendOverflowMode overflowMode = LegendOverflowMode.scroll,
  10. double itemSpacing = 2.0,
  11. Axis? direction,
  12. Axis? scrollDirection,
  13. Offset? offset,
  14. EdgeInsetsGeometry? padding = const EdgeInsets.all(10.0),
  15. EdgeInsetsGeometry? margin,
  16. TextStyle? textStyle,
  17. Size? segmentSize,
  18. LegendLabelsPlacement? labelsPlacement,
  19. LegendEdgeLabelsPlacement? edgeLabelsPlacement = LegendEdgeLabelsPlacement.inside,
  20. LegendLabelOverflow? labelOverflow = LegendLabelOverflow.visible,
  21. LegendPaintingStyle? segmentPaintingStyle = LegendPaintingStyle.solid,
  22. bool isComplex = false,
  23. List<int>? toggledIndices,
  24. LegendPointerBuilder? pointerBuilder,
  25. Size pointerSize = const Size(16.0, 12.0),
  26. Color? pointerColor,
  27. PointerController? pointerController,
})

Creates a SfLegend.

Implementation

const SfLegend.bar({
  required this.items,
  required this.child,
  super.key,
  this.shouldAlwaysShowScrollbar = false,
  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,
}) : _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));