copyWith method
Wave
copyWith({
- WaveDirection? direction,
- WaveGravityDirection? gravityDirection,
- double? amplitude,
- int? frequency,
- double? phase,
- double? offset,
- bool? useScaledOffset,
- Color? color,
- Color? lineColor = _sentinelValue,
- double? lineThickness,
Returns a copy of this object with its field values replaced by the ones provided to this method.
Since lineColor
is nullable, it is defaulted to an empty object in this
method. If left as an empty object, its current value in this Wave
object will be used. This way, if it is null
, the program will know that
it is intentionally being set to null
.
Implementation
Wave copyWith({
WaveDirection? direction,
WaveGravityDirection? gravityDirection,
double? amplitude,
int? frequency,
double? phase,
double? offset,
bool? useScaledOffset,
Color? color,
Color? lineColor = _sentinelValue,
double? lineThickness,
}) {
return Wave(
direction: direction ?? this.direction,
gravityDirection: gravityDirection ?? this.gravityDirection,
amplitude: amplitude ?? this.amplitude,
frequency: frequency ?? this.frequency,
phase: phase ?? this.phase,
offset: offset ?? this.offset,
useScaledOffset: useScaledOffset ?? this.useScaledOffset,
color: color ?? this.color,
lineColor:
identical(lineColor, _sentinelValue) ? this.lineColor : lineColor,
lineThickness: lineThickness ?? this.lineThickness,
);
}