SfLegend.builder constructor

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

Creates a SfLegend.

Implementation

const SfLegend.builder({
  Key? key,
  required this.itemCount,
  required this.itemBuilder,
  this.title,
  this.shouldAlwaysShowScrollbar = false,
  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);