copyWith method

PieData copyWith({
  1. String? label,
  2. double? value,
  3. Color? color,
  4. bool? showValue,
})

Creates a copy of this pie data with the given fields replaced.

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

Implementation

PieData copyWith({
  String? label,
  double? value,
  Color? color,
  bool? showValue,
}) {
  return PieData(
    label: label ?? this.label,
    value: value ?? this.value,
    color: color ?? this.color,
    showValue: showValue ?? this.showValue,
  );
}