copyWith method
SourceElement
copyWith({
- SourceElementType? type,
- String? name,
- int? startPos,
- File? file,
- String? className,
- List<
SourceLine> ? comment, - int? startLine,
- List<
CodeSample> ? samples, - bool? override,
Copy the source element, with some attributes optionally replaced.
Implementation
SourceElement copyWith({
SourceElementType? type,
String? name,
int? startPos,
File? file,
String? className,
List<SourceLine>? comment,
int? startLine,
List<CodeSample>? samples,
bool? override,
}) {
return SourceElement(
type ?? this.type,
name ?? this.name,
startPos ?? this.startPos,
file: file ?? this.file,
className: className ?? this.className,
comment: comment ?? this.comment,
startLine: startLine ?? this.startLine,
samples: samples ?? this.samples,
override: override ?? this.override,
);
}