copyWith method
WidgetbookComponent
copyWith({
- String? name,
- List<
WidgetbookNode> ? children, - String? fileType,
override
Creates a copy of this node with the given properties. Used in filter to create a copy of the sub-tree.
Implementation
@override
WidgetbookComponent copyWith({
String? name,
List<WidgetbookNode>? children,
String? fileType, // Changed to String for icon representation
}) {
return WidgetbookComponent(
name: name ?? this.name,
useCases: children?.cast<WidgetbookUseCase>() ?? this.useCases,
isInitiallyExpanded: isInitiallyExpanded,
fileType: fileType ?? this.fileType, // Copy fileType as a String
);
}