Legend constructor

Legend({
  1. bool? isVisible,
  2. LegendPosition? position,
  3. ChartAlignment? alignment,
  4. Color? backgroundColor,
  5. Color? borderColor,
  6. double? borderWidth,
  7. double? opacity,
  8. String? height,
  9. String? width,
  10. double? padding,
  11. double? iconHeight,
  12. double? iconWidth,
  13. bool? shouldAlwaysShowScrollbar,
  14. bool? toggleSeriesVisibility,
  15. TextStyle? textStyle,
  16. bool? isResponsive,
  17. LegendItemOrientation? orientation,
  18. LegendTitle? title,
  19. LegendItemOverflowMode? overflowMode,
  20. LegendItemBuilder? legendItemBuilder,
  21. Color? iconBorderColor,
  22. double? iconBorderWidth,
  23. double? itemPadding,
  24. Offset? offset,
  25. ImageProvider<Object>? image,
})

Creating an argument constructor of Legend class.

Implementation

Legend(
    {bool? isVisible,
    LegendPosition? position,
    ChartAlignment? alignment,
    this.backgroundColor,
    Color? borderColor,
    double? borderWidth,
    double? opacity,
    this.height,
    this.width,
    double? padding,
    double? iconHeight,
    double? iconWidth,
    bool? shouldAlwaysShowScrollbar,
    bool? toggleSeriesVisibility,
    TextStyle? textStyle,
    bool? isResponsive,
    LegendItemOrientation? orientation,
    LegendTitle? title,
    LegendItemOverflowMode? overflowMode,
    this.legendItemBuilder,
    Color? iconBorderColor,
    double? iconBorderWidth,
    double? itemPadding,
    this.offset,
    this.image})
    : isVisible = isVisible ?? false,
      shouldAlwaysShowScrollbar = shouldAlwaysShowScrollbar ?? false,
      position = position ?? LegendPosition.auto,
      alignment = alignment ?? ChartAlignment.center,
      borderColor = borderColor ?? Colors.transparent,
      borderWidth = borderWidth ?? 0.0,
      iconBorderColor = iconBorderColor ?? Colors.transparent,
      iconBorderWidth = iconBorderWidth ?? 0.0,
      opacity = opacity ?? 1.0,
      padding = padding ?? 10.0,
      textStyle = getTextStyle(
          textStyle: textStyle,
          fontSize: 13.0,
          fontStyle: FontStyle.normal,
          fontFamily: 'Segoe UI'),
      iconHeight = iconHeight ?? 12.0,
      iconWidth = iconWidth ?? 12.0,
      toggleSeriesVisibility = toggleSeriesVisibility ?? true,
      isResponsive = isResponsive ?? false,
      orientation = orientation ?? LegendItemOrientation.auto,
      overflowMode = overflowMode ?? LegendItemOverflowMode.scroll,
      itemPadding = itemPadding ?? 15.0,
      title = title ?? LegendTitle();