getOriginalUrl method
Gets the URL that was originally requested for the current page.
This is not always the same as the URL passed to InAppWebView.onLoadStarted
because although the load for that URL has begun,
the current page may not have changed. Also, there may have been redirects resulting in a different URL to that originally requested.
Supported Platforms/Implementations:
- Android native WebView (Official API - WebView.getOriginalUrl)
- iOS
Implementation
Future<Uri?> getOriginalUrl() async {
Map<String, dynamic> args = <String, dynamic>{};
String? url = await _channel.invokeMethod('getOriginalUrl', args);
return url != null ? Uri.tryParse(url) : null;
}