copyWith method

BehaviorScriptMetadata copyWith({
  1. String? name,
  2. String? category,
  3. bool copyOriginalValues = true,

Returns a copy of this object with its field values replaced by the ones provided to this method.

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.


BehaviorScriptMetadata copyWith({
  String? name,
  String? category,
  bool copyOriginalValues = true,
}) {
  BehaviorScriptMetadata toReturn = BehaviorScriptMetadata(
    name: copyOriginalValues ? _originalName : (name ??,
    category: category ?? this.category,

  if (copyOriginalValues) { = name ??;

  return toReturn;