SfLegend.bar constructor

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

Creates a SfLegend.

Implementation

const SfLegend.bar({
  Key? key,
  required this.items,
  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,
  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);