Publication class
The Publication shared model is the entry-point for all the metadata and services related to a Readium publication.
@param manifest The manifest holding the publication metadata extracted from the publication file. @param fetcher The underlying fetcher used to read publication resources. The default implementation returns Resource.Exception.NotFound for all HREFs. @param servicesBuilder Holds the list of service factories used to create the instances of Publication.Service attached to this Publication. @param positionsFactory Factory used to build lazily the positions.
Constructors
-
Publication({required Manifest manifest, Fetcher fetcher = const EmptyFetcher(), ServicesBuilder? servicesBuilder, Map<
ReadiumCSSName, bool> userSettingsUIPreset = const {}, String? cssStyle})
Properties
- baseUrl → Uri?
-
The URL where this publication is served, computed from the Link with
self
relation.no setter -
context
→ List<
String> -
no setter
- coverLink → Link?
-
Finds the first Link to the publication's cover (rel = cover).
no setter
- credentials → String?
-
Available on Publication, provided by the PublicationContentProtectionServiceExtension extension
Credentials used to unlock this Publication.no setter - cssStyle ↔ String?
-
getter/setter pair
- fetcher → Fetcher
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
images
→ List<
Link> -
Available on Publication, provided by the OpdsPublicationExtension extension
no setter - isProtected → bool
-
Available on Publication, provided by the PublicationContentProtectionServiceExtension extension
Returns whether this Publication is protected by a Content Protection technology.no setter - isRestricted → bool
-
Available on Publication, provided by the PublicationContentProtectionServiceExtension extension
Whether the Publication has a restricted access to its resources, and can't be rendered in a Navigator.no setter - jsonManifest → String
-
Returns the RWPM JSON representation for this Publication's manifest, as a string.
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
→ List<
Link> -
no setter
-
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 - manifest → Manifest
-
final
- metadata → Metadata
-
no setter
- nbPages ↔ int
-
getter/setter pair
-
pageLinks
→ List<
Link> -
Available on Publication, provided by the PageLinksPublication extension
no setter -
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 -
paginationInfo
↔ Map<
Link, LinkPagination> -
getter/setter pair
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- protectionError → UserException?
-
Available on Publication, provided by the PublicationContentProtectionServiceExtension extension
The error raised when trying to unlock the Publication, if any.no setter - protectionLocalizedName → LocalizedString?
-
Available on Publication, provided by the PublicationContentProtectionServiceExtension extension
User-facing localized name for this Content Protection, e.g. "Readium LCP". It could be used in a sentence such as "Protected by {name}".no setter - protectionName → String?
-
Available on Publication, provided by the PublicationContentProtectionServiceExtension extension
User-facing name for this Content Protection, e.g. "Readium LCP". It could be used in a sentence such as "Protected by {name}".no setter - protectionService → ContentProtectionService?
-
Available on Publication, provided by the PublicationContentProtectionServiceExtension extension
no setter -
readingOrder
→ List<
Link> -
Identifies a list of resources in reading order for the publication.
no setter
-
resources
→ List<
Link> -
Identifies resources that are necessary for rendering the publication.
no setter
- rights → UserRights
-
Available on Publication, provided by the PublicationContentProtectionServiceExtension extension
Manages consumption of user rights and permissions.no setter - 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> > -
no setter
-
tableOfContents
→ List<
Link> -
Identifies the collection that contains a table of contents.
no setter
- type ↔ TYPE
-
getter/setter pair
-
userSettingsUIPreset
↔ Map<
ReadiumCSSName, bool> -
getter/setter pair
Methods
-
close(
) → void - Closes any opened resource associated with the Publication, including services.
-
cover(
) → Future< Image?> -
Available on Publication, provided by the PublicationCoverExtension extension
Returns the publication cover as aBitmap
at its maximum size. -
coverFitting(
ImageSize maxSize) → Future< Image?> -
Available on Publication, provided by the PublicationCoverExtension extension
Returns the publication cover as aBitmap
, scaled down to fit the givenmaxSize
. -
findService<
T extends PublicationService> () → T? - Returns the first publication service that is an instance of Type.
-
findServices<
T extends PublicationService> () → Iterable< T> - Returns all the publication services that are instances of Type.
-
get(
Link link) → Resource -
Returns the resource targeted by the given non-templated
link
. -
linksWithRel(
String rel) → List< Link> -
Finds all Links having the given
rel
in the publications's links. -
linksWithRole(
String role) → List< Link> - Returns the links of the first child PublicationCollection with the given role, or an empty list.
-
linkWithHref(
String href) → Link? - Finds the first Link with the given HREF in the publication's links.
-
linkWithRel(
String rel) → Link? -
Finds the first Link having the given
rel
in the publications's links. -
locate(
Locator locator) → Future< Locator?> -
Available on Publication, provided by the PublicationLocatorExtension extension
Locates the target of the givenlocator
. -
locateProgression(
double totalProgression) → Future< Locator?> -
Available on Publication, provided by the PublicationLocatorExtension extension
Locates the target at the givenprogression
relative to the whole publication. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
positions(
) → Future< List< Locator> > -
Available on Publication, provided by the PublicationExtension extension
Returns the list of all the positions in the publication. -
positionsByReadingOrder(
) → Future< List< List< >Locator> > -
Available on Publication, provided by the PublicationExtension extension
Returns the list of all the positions in the publication, grouped by the resource reading order index. -
positionsFromManifest(
) → Future< List< Locator> > -
Available on Publication, provided by the PublicationExtension extension
-
resourceWithHref(
String href) → Link? - Finds the first resource Link (asset or readingOrder item) at the given relative path.
-
setSelfLink(
String href) → void - Sets the URL where this Publication's RWPM manifest is served.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
localBaseUrlOf(
String filename, int port) → String -
Creates the base URL for a Publication locally served through HTTP, from the
publication's
filename
and the HTTP serverport
. -
localUrlOf(
String filename, int port, String href) → String - Gets the absolute URL of a resource locally served through HTTP.