CartesianSeries<T, D> constructor Null safety

CartesianSeries<T, D>(
  1. {ValueKey<String>? key,
  2. ChartIndexedValueMapper<D>? xValueMapper,
  3. ChartIndexedValueMapper? yValueMapper,
  4. ChartIndexedValueMapper<String>? dataLabelMapper,
  5. String? name,
  6. required List<T> dataSource,
  7. String? xAxisName,
  8. String? yAxisName,
  9. ChartIndexedValueMapper<num>? sizeValueMapper,
  10. ChartIndexedValueMapper<Color>? pointColorMapper,
  11. Color? color,
  12. String? legendItemText,
  13. ChartIndexedValueMapper? sortFieldValueMapper,
  14. LinearGradient? gradient,
  15. LinearGradient? borderGradient,
  16. double? width,
  17. ChartIndexedValueMapper<num>? highValueMapper,
  18. ChartIndexedValueMapper<num>? lowValueMapper,
  19. ChartIndexedValueMapper<bool>? intermediateSumPredicate,
  20. ChartIndexedValueMapper<bool>? totalSumPredicate,
  21. List<Trendline>? trendlines,
  22. SeriesRendererCreatedCallback? onRendererCreated,
  23. ChartSeriesRendererFactory<T, D>? onCreateRenderer,
  24. ChartPointInteractionCallback? onPointTap,
  25. ChartPointInteractionCallback? onPointDoubleTap,
  26. ChartPointInteractionCallback? onPointLongPress,
  27. MarkerSettings? markerSettings,
  28. bool? isVisible,
  29. bool? enableTooltip,
  30. EmptyPointSettings? emptyPointSettings,
  31. DataLabelSettings? dataLabelSettings,
  32. double? animationDuration,
  33. List<double>? dashArray,
  34. List<int>? initialSelectedDataIndexes,
  35. Color? borderColor,
  36. double? borderWidth,
  37. SelectionBehavior? selectionBehavior,
  38. bool? isVisibleInLegend,
  39. LegendIconType? legendIconType,
  40. double? opacity,
  41. SortingOrder? sortingOrder}
)

Creating an argument constructor of CartesianSeries class.

Implementation

CartesianSeries(
    {this.key,
    this.xValueMapper,
    this.yValueMapper,
    this.dataLabelMapper,
    this.name,
    required this.dataSource,
    this.xAxisName,
    this.yAxisName,
    this.sizeValueMapper,
    this.pointColorMapper,
    this.color,
    this.legendItemText,
    this.sortFieldValueMapper,
    this.gradient,
    this.borderGradient,
    this.width,
    this.highValueMapper,
    this.lowValueMapper,
    this.intermediateSumPredicate,
    this.totalSumPredicate,
    this.trendlines,
    this.onRendererCreated,
    this.onCreateRenderer,
    this.onPointTap,
    this.onPointDoubleTap,
    this.onPointLongPress,
    MarkerSettings? markerSettings,
    bool? isVisible,
    bool? enableTooltip,
    EmptyPointSettings? emptyPointSettings,
    DataLabelSettings? dataLabelSettings,
    double? animationDuration,
    List<double>? dashArray,
    List<int>? initialSelectedDataIndexes,
    Color? borderColor,
    double? borderWidth,
    SelectionBehavior? selectionBehavior,
    bool? isVisibleInLegend,
    LegendIconType? legendIconType,
    double? opacity,
    SortingOrder? sortingOrder})
    : isVisible = isVisible ?? true,
      markerSettings = markerSettings ?? const MarkerSettings(),
      dataLabelSettings = dataLabelSettings ?? const DataLabelSettings(),
      enableTooltip = enableTooltip ?? true,
      emptyPointSettings = emptyPointSettings ?? EmptyPointSettings(),
      dashArray = dashArray ?? <double>[0, 0],
      initialSelectedDataIndexes = initialSelectedDataIndexes ?? <int>[],
      animationDuration = animationDuration ?? 1500,
      borderColor = borderColor ?? Colors.transparent,
      selectionBehavior = selectionBehavior ?? SelectionBehavior(),
      legendIconType = legendIconType ?? LegendIconType.seriesType,
      isVisibleInLegend = isVisibleInLegend ?? true,
      borderWidth = borderWidth ?? 0,
      opacity = opacity ?? 1,
      sortingOrder = sortingOrder ?? SortingOrder.none,
      super(
          name: name,
          xValueMapper: xValueMapper,
          yValueMapper: yValueMapper,
          sortFieldValueMapper: sortFieldValueMapper,
          pointColorMapper: pointColorMapper,
          dataLabelMapper: dataLabelMapper,
          dataSource: dataSource,
          emptyPointSettings: emptyPointSettings,
          dataLabelSettings: dataLabelSettings,
          enableTooltip: enableTooltip,
          animationDuration: animationDuration,
          selectionBehavior: selectionBehavior,
          legendIconType: legendIconType,
          sortingOrder: sortingOrder,
          opacity: opacity);