currentUrl method

  1. @override
Future<String?> currentUrl()

Accessor to the current URL that the WebView is displaying.

If no URL was ever loaded, returns null.

Implementation

@override
Future<String?> currentUrl() async {
  if (jsBridge.hasReady) {
    return jsBridge.evalJavaScript<String?>('document.location.href');
  } else {
    return _webWebViewParams.iFrame.src;
  }
}