Legend constructor Null safety

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? toggleSeriesVisibility,
  14. TextStyle? textStyle,
  15. bool? isResponsive,
  16. LegendItemOrientation? orientation,
  17. LegendTitle? title,
  18. LegendItemOverflowMode? overflowMode,
  19. LegendItemBuilder? legendItemBuilder,
  20. Color? iconBorderColor,
  21. double? iconBorderWidth,
  22. double? itemPadding,
  23. Offset? offset,
  24. 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? 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,
      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();