getOriginalUrl method Null safety

Future<Uri?> getOriginalUrl()

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.

Official Android API: https://developer.android.com/reference/android/webkit/WebView#getOriginalUrl()

Implementation

Future<Uri?> getOriginalUrl() async {
  Map<String, dynamic> args = <String, dynamic>{};
  String? url = await _channel.invokeMethod('getOriginalUrl', args);
  return url != null ? Uri.parse(url) : null;
}