copyWith method
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,
);
}