Locator class

Provides a precise location in a publication in a format that can be stored and shared.

There are many different use cases for locators:

  • getting back to the last position in a publication
  • bookmarks
  • highlights & annotations
  • search results
  • human-readable (and shareable) reference in a publication

https://github.com/readium/architecture/tree/master/locators

Constructors

Locator({required String href, required String type, String? title, Locations locations = const Locations(), LocatorText text = const LocatorText()})
const

Properties

hashCode → int
The hash code for this object.
no setterinherited
href → String
final
json → String
no setter
locations → Locations
final
props → List<Object?>
The list of properties that will be used to determine whether two instances are equal.
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
text → LocatorText
final
title → String?
final
type → String
final

Methods

copy({String? href, String? type, String? title, Locations? locations, LocatorText? text}) → Locator
copyWithLocations({List<String>? fragments, double? progression = _emptyDoubleValue, int? position = _emptyIntValue, double? totalProgression = _emptyDoubleValue, Map<String, dynamic>? otherLocations}) → Locator
Shortcut to get a copy of the Locator with different Locations sub-properties.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes the object to its 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) → Locator?
fromJsonString(String jsonString) → Locator?