SfLegend.builder constructor

const SfLegend.builder({
  1. Key? key,
  2. required int itemCount,
  3. required IndexedWidgetBuilder? itemBuilder,
  4. Widget? title,
  5. Color? color,
  6. BorderSide? border,
  7. Offset? offset,
  8. EdgeInsetsGeometry? padding,
  9. EdgeInsetsGeometry? margin,
  10. LegendPosition position = LegendPosition.top,
  11. LegendOverflowMode overflowMode = LegendOverflowMode.wrap,
  12. double itemSpacing = 10.0,
  13. double? itemRunSpacing,
  14. double spacing = 5.0,
  15. Axis? direction,
  16. Axis? scrollDirection,
  17. double? width,
  18. double? height,
  19. LegendAlignment? alignment = LegendAlignment.center,
  20. Color? toggledItemColor,
  21. ToggledIndicesChangedCallback? onToggledIndicesChanged,
  22. bool isComplex = false,
  23. List<int>? toggledIndices,
  24. required Widget child,
})

Creates a SfLegend.

Implementation

const SfLegend.builder({
  Key? key,
  required this.itemCount,
  required this.itemBuilder,
  this.title,
  this.color,
  this.border,
  this.offset,
  this.padding,
  this.margin,
  this.position = LegendPosition.top,
  this.overflowMode = LegendOverflowMode.wrap,
  this.itemSpacing = 10.0,
  this.itemRunSpacing,
  this.spacing = 5.0,
  this.direction,
  this.scrollDirection,
  this.width,
  this.height,
  this.alignment = LegendAlignment.center,
  this.toggledItemColor,
  this.onToggledIndicesChanged,
  this.isComplex = false,
  this.toggledIndices,
  required this.child,
})  : _type = _LegendType.vector,
      items = null,
      iconSize = Size.zero,
      textStyle = null,
      imageProvider = null,
      iconType = null,
      iconBorder = null,
      segmentSize = null,
      labelsPlacement = null,
      edgeLabelsPlacement = null,
      labelOverflow = null,
      segmentPaintingStyle = null,
      toggledIconColor = null,
      toggledTextOpacity = 0.5,
      onItemRenderer = null,
      pointerBuilder = null,
      pointerSize = Size.zero,
      pointerColor = null,
      pointerController = null,
      assert(!isComplex || (isComplex && offset == null)),
      super(key: key);