SfLegend.bar constructor

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