copyWith method

  1. @override
WavePainterData copyWith({
  1. Color? backgroundColor,
  2. List<Wave>? waves,
})
override

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