copyWith method

ChartInteractionResult copyWith({
  1. ChartDataPoint? point,
  2. PieData? segment,
  3. int? datasetIndex,
  4. int? elementIndex,
  5. bool? isHit,
})

Creates a copy of this result with the given fields replaced.

Returns a new ChartInteractionResult with the same values as this one, except for the fields that are explicitly provided.

Implementation

ChartInteractionResult copyWith({
  ChartDataPoint? point,
  PieData? segment,
  int? datasetIndex,
  int? elementIndex,
  bool? isHit,
}) {
  return ChartInteractionResult(
    point: point ?? this.point,
    segment: segment ?? this.segment,
    datasetIndex: datasetIndex ?? this.datasetIndex,
    elementIndex: elementIndex ?? this.elementIndex,
    isHit: isHit ?? this.isHit,
  );
}