getCurrentLocation method

Future<EpubLocation> getCurrentLocation()

Returns current location of epub viewer

Implementation

Future<EpubLocation> getCurrentLocation() async {
  checkEpubLoaded();
  final result = await webViewController?.evaluateJavascript(
      source: 'getCurrentLocation()');

  if (result == null) {
    throw Exception("Epub locations not loaded");
  }

  return EpubLocation.fromJson(result);
}