Publication class

Holds the metadata of a Readium publication, as described in the Readium Web Publication Manifest.

Implemented types
Available extensions
Annotations

Constructors

Publication({required Metadata metadata, List<String> context = const [], List<Link> links = const [], List<Link> readingOrder = const [], List<Link> resources = const [], List<Link> tableOfContents = const [], Map<String, List<PublicationCollection>> subCollections = const {}})
const

Properties

conformsToReadiumAudiobook bool
Whether the publication declares conformance to the Readium Audiobook profile.
no setter
conformsToReadiumDivina bool
Whether the publication declares conformance to the Readium DiViNa profile. This is true for CBZ comics and other image-based publications parsed by the ImageParser.
no setter
conformsToReadiumEbook bool
Whether the publication declares conformance to the Readium EPUB profile.
no setter
conformsToReadiumPDF bool
no setter
containsGuidedNavigation bool
Whether the publication has a guided navigation document (application/guided-navigation+json), either as a publication-level link or as per-item alternates in the reading order.
no setter
containsMediaOverlays bool
Whether any reading-order item carries a media overlay alternate — either the older application/vnd.syncnarr+json or the newer Readium Sync Narration application/vnd.readium.narration+json format.
no setter
context List<String>
JSON-LD context URIs declaring the vocabulary used by this manifest.
final
The cover Link, found by rel=cover or by href/type heuristics. null if not present.
no setter
coverUri Uri?
The parsed URI of the cover resource, or null if no cover link is present.
no setter
hashCode int
The hash code for this object.
no setterinherited
identifier String
The publication's unique identifier, or 'unidentified' if none is set.
no setter
images List<Link>

Available on Publication, provided by the OpdsPublicationExtension extension

no setter
isAudioBook bool
Whether this publication should be treated as an audiobook — true for the Readium Audiobook profile and for any EPUB/WebPub that carries audio-text sync data (media overlays or guided navigation).
no setter
landmarks List<Link>

Available on Publication, provided by the PublicationLists extension

Identifies fundamental structural components of the publication in order to enable Reading Systems to provide the User efficient access to them.
no setter
Publication-level links (e.g. self, alternate, cover, guided navigation document).
final
listOfAudioClips List<Link>

Available on Publication, provided by the PublicationLists extension

no setter
listOfIllustrations List<Link>

Available on Publication, provided by the PublicationLists extension

no setter
listOfTables List<Link>

Available on Publication, provided by the PublicationLists extension

no setter
listOfVideoClips List<Link>

Available on Publication, provided by the PublicationLists extension

no setter
metadata Metadata
Bibliographic and descriptive metadata (title, author, language, etc.).
final
pageList List<Link>

Available on Publication, provided by the PublicationLists extension

Provides navigation to positions in the Publication content that correspond to the locations of page boundaries present in a print source being represented by this EPUB Publication.
no setter
pageListOrGenerated List<Link>

Available on Publication, provided by the PublicationLists extension

Returns pageList if available, or generates a page list from metadata.numberOfPages for PDFs without an embedded page list.
no setter
props List<Object>
The list of properties that will be used to determine whether two instances are equal.
no setter
readingOrder List<Link>
Ordered list of content documents that make up the reading experience.
final
resources List<Link>
Resources referenced by the publication but not part of the reading order (images, audio files, stylesheets, etc.).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited
subCollections Map<String, List<PublicationCollection>>
Named sub-collections beyond the standard manifest fields (e.g. page-list, landmarks).
final
tableOfContents List<Link>
Hierarchical table of contents. Use tocFlattened for a flat list.
final
toc List<Link>
Alias for tableOfContents.
no setter
tocFlattened List<Link>
Returns a flattened version of the table of contents, where all children links are recursively.
no setter

Methods

Returns the links of the first child PublicationCollection with the given role, or an empty list.
copyWith({List<String>? context, Metadata? metadata, List<Link>? links, List<Link>? readingOrder, List<Link>? resources, List<Link>? tableOfContents, Map<String, List<PublicationCollection>>? subCollections}) Publication
Returns a copy of this publication with the given fields replaced.
linksWithRel(String rel) List<Link>
Finds all Links having the given rel in the manifest's links.
linkWithHref(String href) Link?
Finds the first Link with the given HREF in the manifest's links.
linkWithRel(String rel) Link?
Finds the first Link with the given relation in the manifest's links.
Creates a Locator pointing at the given link.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Serializes a Publication to its RWPM JSON representation.
override
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromJson(Map<String, dynamic>? json, {bool packaged = false}) Publication?
Parses a Publication from its RWPM JSON representation.