copyWith method

TreeNode copyWith({
  1. String? title,
  2. String? code,
  3. bool? isCheck,
  4. int? hierarchy,
  5. TreeNode? parent,
  6. List<TreeNode>? children,
})

Implementation

TreeNode copyWith({
  String? title,
  String? code,
  bool? isCheck,
  int? hierarchy,
  TreeNode? parent,
  List<TreeNode>? children,
}) {
  return TreeNode(
    title: title ?? this.title,
    code: code ?? this.code,
    isCheck: isCheck ?? this.isCheck,
    hierarchy: hierarchy ?? this.hierarchy,
    parent: parent ?? this.parent,
    children: children ?? [],
  );
}