SfLegend constructor

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

Creates a SfLegend.

Implementation

const SfLegend({
  Key? key,
  required this.items,
  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,
  required this.child,
})  : _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)),
      super(key: key);