copyWith method

  1. @override
WidgetbookFolder copyWith({
  1. String? name,
  2. List<WidgetbookNode>? children,
  3. 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
WidgetbookFolder copyWith({
  String? name,
  List<WidgetbookNode>? children,
  String? fileType, // Changed to String for icon representation
}) {
  return WidgetbookFolder(
    name: name ?? this.name,
    children: children ?? this.children,
    isInitiallyExpanded: isInitiallyExpanded,
    fileType: fileType ?? this.fileType, // Copy fileType as a String
  );
}