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