Publication class

Represents a Readium Web Publication Manifest (RWPM).

A publication contains all metadata, content structure, and resources needed to render an ebook, audiobook, or comic.

Structure

Publication
├── metadata (title, author, language, etc.)
├── readingOrder (sequential content spine)
├── resources (images, stylesheets, fonts)
├── tableOfContents (navigation structure)
└── subCollections (page-list, landmarks, etc.)

Common Operations

// Find a content document by href
final link = publication.linkWithHref('chapter1.xhtml');

// Get the cover image
final coverUrl = publication.coverUri;

// Convert a TOC link to a locator for navigation
final locator = publication.locatorFromLink(tocEntry);

See also:

  • Metadata for publication metadata details
  • Link for content and resource links
  • Locator for position tracking
Implemented types
Available extensions

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 {}})
Creates a new publication with the given components.
const

Properties

conformsToReadiumAudiobook → bool
Returns true if this publication conforms to the Readium audiobook profile.
no setter
conformsToReadiumEbook → bool
Returns true if this publication conforms to the Readium EPUB profile.
no setter
containsMediaOverlays → bool
Returns true if this publication contains media overlays (synchronized narration).
no setter
context → List<String>
JSON-LD context URIs for the manifest.
final
Returns the cover image link, if available.
no setter
coverUri → Uri?
Returns the cover image URI, if available.
no setter
hashCode → int
The hash code for this object.
no setterinherited
identifier → String
Returns the publication identifier from metadata, or 'unidentified'.
no setter
images → List<Link>

Available on Publication, provided by the OpdsPublicationExtension extension

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
Links to related resources (self, alternate, search, etc.).
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
Publication metadata including title, authors, 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
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 forming the reading spine.
final
resources → List<Link>
Additional resources like images, stylesheets, and fonts.
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 subcollections like page-list, landmarks, or guided navigation.
final
tableOfContents → List<Link>
Navigation table of contents structure.
final
toc → List<Link>
Alias for tableOfContents.
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
Creates 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.
Converts a Link to a Locator for navigation.
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.
normalizeHref(String baseUrl) → LinkHrefNormalizer