SfLegend constructor
const
SfLegend({
- Key? key,
- required List<
LegendItem> ? items, - Widget? title,
- Color? color,
- BorderSide? border,
- LegendPosition position = LegendPosition.top,
- LegendOverflowMode overflowMode = LegendOverflowMode.wrap,
- double spacing = 5.0,
- double itemSpacing = 10.0,
- double? itemRunSpacing,
- Size iconSize = const Size(8.0, 8.0),
- BorderSide? iconBorder,
- Axis? direction,
- Axis? scrollDirection,
- double? width,
- double? height,
- LegendAlignment? alignment = LegendAlignment.center,
- Offset? offset,
- EdgeInsetsGeometry? padding = const EdgeInsets.all(10.0),
- EdgeInsetsGeometry? margin,
- TextStyle? textStyle,
- ShapeMarkerType? iconType = ShapeMarkerType.circle,
- ImageProvider<
Object> ? imageProvider, - Color? toggledIconColor,
- double toggledTextOpacity = 0.5,
- ToggledIndicesChangedCallback? onToggledIndicesChanged,
- ItemRenderCallback? onItemRenderer,
- bool isComplex = false,
- List<
int> ? toggledIndices, - required Widget child,
Creates a SfLegend.
Implementation
const SfLegend({
Key? key,
required this.items,
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);