copyWith method
Returns a copy of this object with its field values replaced by the ones provided to this method.
Since action
is nullable, it is defaulted to an empty string in this
method. If left as an empty string, its current value in this
EntertainmentSegment object will be used. This way, if it is
null
, the program will know that it is intentionally being set to
null
.
copyOriginalValues
is true if you want to maintain the original object's
initial values. This is useful if you plan on using this object in a PUT
request.
Implementation
EntertainmentSegment copyWith({
int? start,
int? length,
bool copyOriginalValues = true,
}) {
return EntertainmentSegment(
start: start ?? this.start,
length: length ?? this.length,
);
}