copyWith method
Creates a copy of this object with the given fields replaced with the new values.
For nullable fields, passing null leaves the field unchanged (standard
Dart copyWith behavior). To explicitly reset a nullable field to
null, pass a domain-invalid sentinel value:
String?fields: pass an empty string (isEmpty) to reset tonull.List?/Set?fields: pass an empty collection (isEmpty) to reset tonull.double?/int?fields (positive-only, e.g. height/width/angle): pass a negative value (isNegative) to reset tonull.
These sentinel values are never valid for the respective fields (enforced by constructor assertions), making the intent unambiguous.
Implementation
Script copyWith({
String? code,
String? codeNumeric,
String? date,
String? name,
String? pva,
}) => ScriptCustom(
code: code ?? this.code,
name: name ?? this.name,
codeNumeric: codeNumeric ?? this.codeNumeric,
date: date ?? this.date,
pva: (pva?.isEmpty ?? false) ? null : (pva ?? this.pva),
);