toLocator method

Locator toLocator()

Creates a Locator from a reading order Link.

Implementation

Locator toLocator() {
  List<String> components = href.split("#");
  String? fragment = (components.length > 1) ? components[1] : null;
  return Locator(
    href: components.firstOrDefault(href),
    type: type ?? "",
    title: title,
    locations: Locations(fragments: fragment?.let((it) => [it]) ?? []),
  );
}