requestImageRef method Null safety

Future<RequestImageRefResult?> requestImageRef()

Requests the URL of the image last touched by the user.

NOTE: On iOS it is implemented using JavaScript.

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

Implementation

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