getHitTestResult method
- @SupportedPlatforms.new(platforms: [AndroidPlatform(apiName: 'WebView.getHitTestResult', apiUrl: 'https://developer.android.com/reference/android/webkit/WebView#getHitTestResult()'), IOSPlatform(note: 'This method is implemented using JavaScript.'), LinuxPlatform(apiName: 'WebKitHitTestResult', apiUrl: 'https://webkitgtk.org/reference/webkit2gtk/stable/WebKitHitTestResult.html', note: 'This method uses native WebKitHitTestResult from the mouse-target-changed signal.')])
Gets the hit result for hitting an HTML elements.
Officially Supported Platforms/Implementations:
- Android WebView (Official API - WebView.getHitTestResult)
- iOS WKWebView:
- This method is implemented using JavaScript.
- Linux WPE WebKit (Official API - WebKitHitTestResult):
- This method uses native WebKitHitTestResult from the mouse-target-changed signal.
Use the PlatformInAppWebViewController.isMethodSupported method to check if this method is supported at runtime.
Implementation
@SupportedPlatforms(
platforms: [
AndroidPlatform(
apiName: 'WebView.getHitTestResult',
apiUrl:
'https://developer.android.com/reference/android/webkit/WebView#getHitTestResult()',
),
IOSPlatform(note: 'This method is implemented using JavaScript.'),
LinuxPlatform(
apiName: 'WebKitHitTestResult',
apiUrl:
'https://webkitgtk.org/reference/webkit2gtk/stable/WebKitHitTestResult.html',
note:
'This method uses native WebKitHitTestResult from the mouse-target-changed signal.',
),
],
)
Future<InAppWebViewHitTestResult?> getHitTestResult() {
throw UnimplementedError(
'${PlatformInAppWebViewControllerMethod.getHitTestResult.name} is not implemented on the current platform',
);
}