getUrl method

  1. @override
Future<WebUri?> getUrl()

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:

Implementation

@override
Future<WebUri?> getUrl() async {
  Map<String, dynamic> args = <String, dynamic>{};
  String? url = await channel?.invokeMethod<String?>('getUrl', args);
  return url != null ? WebUri(url) : null;
}