operator + method

Book operator +(
  1. Book other
)

Implementation

Book operator +(Book other) {
  List<Author> mergedAuthors = authors;
  mergedAuthors.addAll(other.authors);
  mergedAuthors = mergedAuthors.toSet().toList();

  return Book(
      heading: heading,
      authors: mergedAuthors,
      chapters: chapters + other.chapters,
      appendices: appendices! + other.appendices!);
}