onNavigationResponse property

  1. @SupportedPlatforms.new(platforms: [IOSPlatform(apiName: 'WKNavigationDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview'), MacOSPlatform(apiName: 'WKNavigationDelegate.webView', apiUrl: 'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview'), LinuxPlatform(apiName: 'WebKitWebView::decide-policy', apiUrl: 'https://webkitgtk.org/reference/webkit2gtk/stable/signal.WebView.decide-policy.html')])
FutureOr<NavigationResponseAction?> Function(T controller, NavigationResponse navigationResponse)? onNavigationResponse
final

Called when a web view asks for permission to navigate to new content after the response to the navigation request is known.

navigationResponse represents the navigation response.

NOTE: In order to be able to listen this event, check the InAppWebViewSettings.useOnNavigationResponse setting documentation.

Officially Supported Platforms/Implementations:

Parameters - Officially Supported Platforms/Implementations:

  • navigationResponse: all platforms

Use the PlatformWebViewCreationParams.isPropertySupported method to check if this property is supported at runtime.

Implementation

@SupportedPlatforms(
  platforms: [
    IOSPlatform(
      apiName: 'WKNavigationDelegate.webView',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview',
    ),
    MacOSPlatform(
      apiName: 'WKNavigationDelegate.webView',
      apiUrl:
          'https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455643-webview',
    ),
    LinuxPlatform(
      apiName: 'WebKitWebView::decide-policy',
      apiUrl:
          'https://webkitgtk.org/reference/webkit2gtk/stable/signal.WebView.decide-policy.html',
    ),
  ],
)
final FutureOr<NavigationResponseAction?> Function(
  T controller,
  NavigationResponse navigationResponse,
)?
onNavigationResponse;