getLocatorFragments method

Future<Locator?> getLocatorFragments(
  1. Locator locator
)

Get locator fragments for the given locator.

Implementation

Future<Locator?> getLocatorFragments(final Locator locator) {
  R2Log.d('locator: ${locator.toString()}');

  return _invokeMethod(
    _ReaderChannelMethodInvoke.getLocatorFragments,
    json.encode(locator.toJson()),
  ).then((final value) => Locator.fromJson(json.decode(value))).onError((
    final error,
    final _,
  ) {
    R2Log.e(error ?? 'Unknown Error');

    throw ReadiumException('getLocatorFragments failed $locator');
  });
}