copyWith method
Returns a copy of this object with its field values replaced by the ones provided to this method.
Implementation
@override
WavePainterData copyWith({
Color? backgroundColor,
List<Wave>? waves,
}) {
return WavePainterData(
backgroundColor: backgroundColor ?? this.backgroundColor,
waves: waves ?? _waves.map((wave) => wave.copy()).toList(),
);
}