copyWith method

LineChartBarData copyWith({
  1. List<FlSpot>? spots,
  2. bool? show,
  3. Color? color,
  4. Gradient? gradient,
  5. double? barWidth,
  6. bool? isCurved,
  7. double? curveSmoothness,
  8. bool? preventCurveOverShooting,
  9. double? preventCurveOvershootingThreshold,
  10. bool? isStrokeCapRound,
  11. bool? isStrokeJoinRound,
  12. BarAreaData? belowBarData,
  13. BarAreaData? aboveBarData,
  14. FlDotData? dotData,
  15. List<int>? dashArray,
  16. List<int>? showingIndicators,
  17. Shadow? shadow,
  18. bool? isStepLineChart,
  19. LineChartStepData? lineChartStepData,
})

Copies current LineChartBarData to a new LineChartBarData, and replaces provided values.

Implementation

LineChartBarData copyWith({
  List<FlSpot>? spots,
  bool? show,
  Color? color,
  Gradient? gradient,
  double? barWidth,
  bool? isCurved,
  double? curveSmoothness,
  bool? preventCurveOverShooting,
  double? preventCurveOvershootingThreshold,
  bool? isStrokeCapRound,
  bool? isStrokeJoinRound,
  BarAreaData? belowBarData,
  BarAreaData? aboveBarData,
  FlDotData? dotData,
  List<int>? dashArray,
  List<int>? showingIndicators,
  Shadow? shadow,
  bool? isStepLineChart,
  LineChartStepData? lineChartStepData,
}) {
  return LineChartBarData(
    spots: spots ?? this.spots,
    show: show ?? this.show,
    color: color ?? this.color,
    gradient: gradient ?? this.gradient,
    barWidth: barWidth ?? this.barWidth,
    isCurved: isCurved ?? this.isCurved,
    curveSmoothness: curveSmoothness ?? this.curveSmoothness,
    preventCurveOverShooting:
        preventCurveOverShooting ?? this.preventCurveOverShooting,
    preventCurveOvershootingThreshold: preventCurveOvershootingThreshold ??
        this.preventCurveOvershootingThreshold,
    isStrokeCapRound: isStrokeCapRound ?? this.isStrokeCapRound,
    isStrokeJoinRound: isStrokeJoinRound ?? this.isStrokeJoinRound,
    belowBarData: belowBarData ?? this.belowBarData,
    aboveBarData: aboveBarData ?? this.aboveBarData,
    dashArray: dashArray ?? this.dashArray,
    dotData: dotData ?? this.dotData,
    showingIndicators: showingIndicators ?? this.showingIndicators,
    shadow: shadow ?? this.shadow,
    isStepLineChart: isStepLineChart ?? this.isStepLineChart,
    lineChartStepData: lineChartStepData ?? this.lineChartStepData,
  );
}