getUrl method Null safety

Future<Uri?> getUrl()

Gets the URL for the current page. This is not always the same as the URL passed to WebView.onLoadStart because although the load for that URL has begun, the current page may not have changed.

Supported Platforms/Implementations:

Implementation

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