copyWith method

BarGroupInfo copyWith({
  1. int? index,
  2. int? count,
  3. double? gap,
  4. BarLayoutMode? layoutMode,
  5. String? groupId,
  6. bool clearGroupId = false,
  7. double? stackBaseline,
  8. Map<int, double>? startValues,
  9. Map<int, double>? endValues,
  10. Map<int, double>? percentages,
  11. Set<int>? outerPointIndices,
  12. bool? drawTrack,
})

Creates a copy with optional field overrides.

Any parameter that is null will use the current value.

Example:

final original = BarGroupInfo(index: 0, count: 3, gap: 2.0);
final modified = original.copyWith(gap: 4.0);
// modified has index=0, count=3, gap=4.0

Implementation

BarGroupInfo copyWith({
  int? index,
  int? count,
  double? gap,
  BarLayoutMode? layoutMode,
  String? groupId,
  bool clearGroupId = false,
  double? stackBaseline,
  Map<int, double>? startValues,
  Map<int, double>? endValues,
  Map<int, double>? percentages,
  Set<int>? outerPointIndices,
  bool? drawTrack,
}) {
  return BarGroupInfo(
    index: index ?? this.index,
    count: count ?? this.count,
    gap: gap ?? this.gap,
    layoutMode: layoutMode ?? this.layoutMode,
    groupId: clearGroupId ? null : (groupId ?? this.groupId),
    stackBaseline: stackBaseline ?? this.stackBaseline,
    startValues: startValues ?? this.startValues,
    endValues: endValues ?? this.endValues,
    percentages: percentages ?? this.percentages,
    outerPointIndices: outerPointIndices ?? this.outerPointIndices,
    drawTrack: drawTrack ?? this.drawTrack,
  );
}