copyWith method

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

Implementation

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