SfLegend constructor

const SfLegend({
  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.wrap,
  10. double spacing = 5.0,
  11. double itemSpacing = 10.0,
  12. double? itemRunSpacing,
  13. Size iconSize = const Size(8.0, 8.0),
  14. BorderSide? iconBorder,
  15. Axis? direction,
  16. Axis? scrollDirection,
  17. double? width,
  18. double? height,
  19. LegendAlignment? alignment = LegendAlignment.center,
  20. Offset? offset,
  21. EdgeInsetsGeometry? padding = const EdgeInsets.all(10.0),
  22. EdgeInsetsGeometry? margin,
  23. TextStyle? textStyle,
  24. ShapeMarkerType? iconType = ShapeMarkerType.circle,
  25. ImageProvider<Object>? imageProvider,
  26. Color? toggledIconColor,
  27. double toggledTextOpacity = 0.5,
  28. ToggledIndicesChangedCallback? onToggledIndicesChanged,
  29. ItemRenderCallback? onItemRenderer,
  30. bool isComplex = false,
  31. List<int>? toggledIndices,
})

Creates a SfLegend.

Implementation

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