getRectFromCfi method
Get bounding rectangle for a given CFI range Returns WebView-relative coordinates in pixels, or null if rect cannot be determined
Implementation
Future<Rect?> getRectFromCfi(String cfiRange) async {
checkEpubLoaded();
cfiRectCompleter = Completer<Rect?>();
// Escape quotes in the CFI string
var escapedCfi = cfiRange.replaceAll('"', '\\"');
await webViewController?.evaluateJavascript(source: 'getRectFromCfi("$escapedCfi")');
return cfiRectCompleter.future;
}