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/models/locators

Inheritance
Implemented types

Constructors

Locator({required String href, required String type, LocatorText? text, Locations? locations, String? title, Map<String, dynamic> additionalProperties = const {}})
const

Properties

additionalProperties Map<String, dynamic>
finalinherited
hashCode int
The hash code for this object.
no setterinherited
href String
final
hrefPath String
Returns /path from href without #fragment and query parameters.
no setter
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

copyWith({String? href, String? type, String? title, Locations? locations, LocatorText? text, Map<String, dynamic>? additionalProperties}) 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.
getAdditionalDateTime(String key) DateTime?
Helper to get a DateTime from an additional property value.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
safeGetAdditionalValue<T>(String key) → T?
Safely get an additional property value of type T.
inherited
toJson() Map<String, dynamic>
Serializes the object to its JSON representation.
override
toString() String
A string representation of this object.
override
toTextLocator() Locator

Operators

operator ==(Object other) bool
The equality operator.
inherited
operator [](String key) → dynamic
Syntactic sugar to access the additionalProperties values by subscripting directly. obj["layout"] == obj.additionalProperties["layout"]
inherited

Static Methods

fromJson(Map<String, dynamic>? json) Locator?
fromJsonString(String jsonString) Locator?