SfLegend.builder constructor
const
SfLegend.builder({
- Key? key,
- required int itemCount,
- required IndexedWidgetBuilder? itemBuilder,
- Widget? title,
- Color? color,
- BorderSide? border,
- Offset? offset,
- EdgeInsetsGeometry? padding,
- EdgeInsetsGeometry? margin,
- LegendPosition position = LegendPosition.top,
- LegendOverflowMode overflowMode = LegendOverflowMode.wrap,
- double itemSpacing = 10.0,
- double? itemRunSpacing,
- double spacing = 5.0,
- Axis? direction,
- Axis? scrollDirection,
- double? width,
- double? height,
- LegendAlignment? alignment = LegendAlignment.center,
- Color? toggledItemColor,
- ToggledIndicesChangedCallback? onToggledIndicesChanged,
- bool isComplex = false,
- List<
int> ? toggledIndices, - 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);