getUrl method
Gets the URL for the current page. This is not always the same as the URL passed to PlatformWebViewCreationParams.onLoadStart because although the load for that URL has begun, the current page may not have changed.
NOTE for Web: If window.location.href
isn't accessible inside the iframe,
it will return the current value of the iframe.src
attribute.
Officially Supported Platforms/Implementations:
- Android native WebView (Official API - WebView.getUrl)
- iOS (Official API - WKWebView.url)
- MacOS (Official API - WKWebView.url)
- Web
- Windows (Official API - ICoreWebView2.get_Source)
Implementation
Future<WebUri?> getUrl() => platform.getUrl();