Book constructor

const Book({
  1. required String key,
  2. required String title,
  3. @JsonKey.new(name: 'publish_date') String? publishDate,
  4. List<String>? publishers,
  5. @JsonKey.new(name: 'number_of_pages') int? numberOfPages,
  6. List<int>? covers,
  7. @Default.new([]) List<AuthorKey> authors,
  8. @JsonKey.new(name: 'isbn_10') List<String>? isbn10,
  9. @JsonKey.new(name: 'isbn_13') List<String>? isbn13,
})

Implementation

const factory Book({
  required String key,
  required String title,
  @JsonKey(name: 'publish_date') String? publishDate,
  List<String>? publishers,
  @JsonKey(name: 'number_of_pages') int? numberOfPages,
  List<int>? covers,
  @Default([]) List<AuthorKey> authors,
  @JsonKey(name: 'isbn_10') List<String>? isbn10,
  @JsonKey(name: 'isbn_13') List<String>? isbn13,
}) = _Book;