copyWith method

BarChartData copyWith({
  1. List<BarChartGroupData>? barGroups,
  2. double? groupsSpace,
  3. BarChartAlignment? alignment,
  4. FlTitlesData? titlesData,
  5. RangeAnnotations? rangeAnnotations,
  6. BarTouchData? barTouchData,
  7. FlGridData? gridData,
  8. FlBorderData? borderData,
  9. double? maxY,
  10. double? minY,
  11. double? baselineY,
  12. Color? backgroundColor,
  13. ExtraLinesData? extraLinesData,
})

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

Implementation

BarChartData copyWith({
  List<BarChartGroupData>? barGroups,
  double? groupsSpace,
  BarChartAlignment? alignment,
  FlTitlesData? titlesData,
  RangeAnnotations? rangeAnnotations,
  BarTouchData? barTouchData,
  FlGridData? gridData,
  FlBorderData? borderData,
  double? maxY,
  double? minY,
  double? baselineY,
  Color? backgroundColor,
  ExtraLinesData? extraLinesData,
}) {
  return BarChartData(
    barGroups: barGroups ?? this.barGroups,
    groupsSpace: groupsSpace ?? this.groupsSpace,
    alignment: alignment ?? this.alignment,
    titlesData: titlesData ?? this.titlesData,
    rangeAnnotations: rangeAnnotations ?? this.rangeAnnotations,
    barTouchData: barTouchData ?? this.barTouchData,
    gridData: gridData ?? this.gridData,
    borderData: borderData ?? this.borderData,
    maxY: maxY ?? this.maxY,
    minY: minY ?? this.minY,
    baselineY: baselineY ?? this.baselineY,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    extraLinesData: extraLinesData ?? this.extraLinesData,
  );
}