HeadlessInAppWebView constructor

HeadlessInAppWebView({
  1. Size initialSize = const Size(-1, -1),
  2. int? windowId,
  3. HeadlessInAppWebView? headlessWebView,
  4. InAppWebViewKeepAlive? keepAlive,
  5. bool? preventGestureDelay,
  6. @Deprecated('Use onGeolocationPermissionsHidePrompt instead') void androidOnGeolocationPermissionsHidePrompt(
    1. InAppWebViewController controller
    )?,
  7. @Deprecated('Use onGeolocationPermissionsShowPrompt instead') Future<GeolocationPermissionShowPromptResponse?> androidOnGeolocationPermissionsShowPrompt(
    1. InAppWebViewController controller,
    2. String origin
    )?,
  8. @Deprecated('Use onPermissionRequest instead') Future<PermissionRequestResponse?> androidOnPermissionRequest(
    1. InAppWebViewController controller,
    2. String origin,
    3. List<String> resources
    )?,
  9. @Deprecated('Use onSafeBrowsingHit instead') Future<SafeBrowsingResponse?> androidOnSafeBrowsingHit(
    1. InAppWebViewController controller,
    2. Uri url,
    3. SafeBrowsingThreat? threatType
    )?,
  10. InAppWebViewInitialData? initialData,
  11. String? initialFile,
  12. @Deprecated('Use initialSettings instead') InAppWebViewGroupOptions? initialOptions,
  13. InAppWebViewSettings? initialSettings,
  14. URLRequest? initialUrlRequest,
  15. UnmodifiableListView<UserScript>? initialUserScripts,
  16. PullToRefreshController? pullToRefreshController,
  17. FindInteractionController? findInteractionController,
  18. ContextMenu? contextMenu,
  19. void onPageCommitVisible(
    1. InAppWebViewController controller,
    2. WebUri? url
    )?,
  20. void onTitleChanged(
    1. InAppWebViewController controller,
    2. String? title
    )?,
  21. @Deprecated('Use onDidReceiveServerRedirectForProvisionalNavigation instead') void iosOnDidReceiveServerRedirectForProvisionalNavigation(
    1. InAppWebViewController controller
    )?,
  22. @Deprecated('Use onWebContentProcessDidTerminate instead') void iosOnWebContentProcessDidTerminate(
    1. InAppWebViewController controller
    )?,
  23. @Deprecated('Use onNavigationResponse instead') Future<IOSNavigationResponseAction?> iosOnNavigationResponse(
    1. InAppWebViewController controller,
    2. IOSWKNavigationResponse navigationResponse
    )?,
  24. @Deprecated('Use shouldAllowDeprecatedTLS instead') Future<IOSShouldAllowDeprecatedTLSAction?> iosShouldAllowDeprecatedTLS(
    1. InAppWebViewController controller,
    2. URLAuthenticationChallenge challenge
    )?,
  25. Future<AjaxRequestAction> onAjaxProgress(
    1. InAppWebViewController controller,
    2. AjaxRequest ajaxRequest
    )?,
  26. Future<AjaxRequestAction?> onAjaxReadyStateChange(
    1. InAppWebViewController controller,
    2. AjaxRequest ajaxRequest
    )?,
  27. void onConsoleMessage(
    1. InAppWebViewController controller,
    2. ConsoleMessage consoleMessage
    )?,
  28. Future<bool?> onCreateWindow(
    1. InAppWebViewController controller,
    2. CreateWindowAction createWindowAction
    )?,
  29. void onCloseWindow(
    1. InAppWebViewController controller
    )?,
  30. void onWindowFocus(
    1. InAppWebViewController controller
    )?,
  31. void onWindowBlur(
    1. InAppWebViewController controller
    )?,
  32. @Deprecated('Use onReceivedIcon instead') void androidOnReceivedIcon(
    1. InAppWebViewController controller,
    2. Uint8List icon
    )?,
  33. @Deprecated('Use onReceivedTouchIconUrl instead') void androidOnReceivedTouchIconUrl(
    1. InAppWebViewController controller,
    2. Uri url,
    3. bool precomposed
    )?,
  34. @Deprecated('Use onDownloadStartRequest instead') void onDownloadStart(
    1. InAppWebViewController controller,
    2. Uri url
    )?,
  35. void onDownloadStartRequest(
    1. InAppWebViewController controller,
    2. DownloadStartRequest downloadStartRequest
    )?,
  36. @Deprecated('Use FindInteractionController.onFindResultReceived instead') void onFindResultReceived(
    1. InAppWebViewController controller,
    2. int activeMatchOrdinal,
    3. int numberOfMatches,
    4. bool isDoneCounting,
    )?,
  37. Future<JsAlertResponse?> onJsAlert(
    1. InAppWebViewController controller,
    2. JsAlertRequest jsAlertRequest
    )?,
  38. Future<JsConfirmResponse?> onJsConfirm(
    1. InAppWebViewController controller,
    2. JsConfirmRequest jsConfirmRequest
    )?,
  39. Future<JsPromptResponse?> onJsPrompt(
    1. InAppWebViewController controller,
    2. JsPromptRequest jsPromptRequest
    )?,
  40. @Deprecated("Use onReceivedError instead") void onLoadError(
    1. InAppWebViewController controller,
    2. Uri? url,
    3. int code,
    4. String message,
    )?,
  41. void onReceivedError(
    1. InAppWebViewController controller,
    2. WebResourceRequest request,
    3. WebResourceError error
    )?,
  42. @Deprecated("Use onReceivedHttpError instead") void onLoadHttpError(
    1. InAppWebViewController controller,
    2. Uri? url,
    3. int statusCode,
    4. String description,
    )?,
  43. void onReceivedHttpError(
    1. InAppWebViewController controller,
    2. WebResourceRequest request,
    3. WebResourceResponse errorResponse
    )?,
  44. void onLoadResource(
    1. InAppWebViewController controller,
    2. LoadedResource resource
    )?,
  45. @Deprecated('Use onLoadResourceWithCustomScheme instead') Future<CustomSchemeResponse?> onLoadResourceCustomScheme(
    1. InAppWebViewController controller,
    2. Uri url
    )?,
  46. Future<CustomSchemeResponse?> onLoadResourceWithCustomScheme(
    1. InAppWebViewController controller,
    2. WebResourceRequest request
    )?,
  47. void onLoadStart(
    1. InAppWebViewController controller,
    2. WebUri? url
    )?,
  48. void onLoadStop(
    1. InAppWebViewController controller,
    2. WebUri? url
    )?,
  49. void onLongPressHitTestResult(
    1. InAppWebViewController controller,
    2. InAppWebViewHitTestResult hitTestResult
    )?,
  50. @Deprecated("Use onPrintRequest instead") void onPrint(
    1. InAppWebViewController controller,
    2. Uri? url
    )?,
  51. Future<bool?> onPrintRequest(
    1. InAppWebViewController controller,
    2. WebUri? url,
    3. PlatformPrintJobController? printJobController
    )?,
  52. void onProgressChanged(
    1. InAppWebViewController controller,
    2. int progress
    )?,
  53. Future<ClientCertResponse?> onReceivedClientCertRequest(
    1. InAppWebViewController controller,
    2. URLAuthenticationChallenge challenge
    )?,
  54. Future<HttpAuthResponse?> onReceivedHttpAuthRequest(
    1. InAppWebViewController controller,
    2. URLAuthenticationChallenge challenge
    )?,
  55. Future<ServerTrustAuthResponse?> onReceivedServerTrustAuthRequest(
    1. InAppWebViewController controller,
    2. URLAuthenticationChallenge challenge
    )?,
  56. void onScrollChanged(
    1. InAppWebViewController controller,
    2. int x,
    3. int y
    )?,
  57. void onUpdateVisitedHistory(
    1. InAppWebViewController controller,
    2. WebUri? url,
    3. bool? isReload
    )?,
  58. void onWebViewCreated(
    1. InAppWebViewController controller
    )?,
  59. Future<AjaxRequest?> shouldInterceptAjaxRequest(
    1. InAppWebViewController controller,
    2. AjaxRequest ajaxRequest
    )?,
  60. Future<FetchRequest?> shouldInterceptFetchRequest(
    1. InAppWebViewController controller,
    2. FetchRequest fetchRequest
    )?,
  61. Future<NavigationActionPolicy?> shouldOverrideUrlLoading(
    1. InAppWebViewController controller,
    2. NavigationAction navigationAction
    )?,
  62. void onEnterFullscreen(
    1. InAppWebViewController controller
    )?,
  63. void onExitFullscreen(
    1. InAppWebViewController controller
    )?,
  64. void onOverScrolled(
    1. InAppWebViewController controller,
    2. int x,
    3. int y,
    4. bool clampedX,
    5. bool clampedY,
    )?,
  65. void onZoomScaleChanged(
    1. InAppWebViewController controller,
    2. double oldScale,
    3. double newScale
    )?,
  66. @Deprecated('Use shouldInterceptRequest instead') Future<WebResourceResponse?> androidShouldInterceptRequest(
    1. InAppWebViewController controller,
    2. WebResourceRequest request
    )?,
  67. @Deprecated('Use onRenderProcessUnresponsive instead') Future<WebViewRenderProcessAction?> androidOnRenderProcessUnresponsive(
    1. InAppWebViewController controller,
    2. Uri? url
    )?,
  68. @Deprecated('Use onRenderProcessResponsive instead') Future<WebViewRenderProcessAction?> androidOnRenderProcessResponsive(
    1. InAppWebViewController controller,
    2. Uri? url
    )?,
  69. @Deprecated('Use onRenderProcessGone instead') void androidOnRenderProcessGone(
    1. InAppWebViewController controller,
    2. RenderProcessGoneDetail detail
    )?,
  70. @Deprecated('Use onFormResubmission instead') Future<FormResubmissionAction?> androidOnFormResubmission(
    1. InAppWebViewController controller,
    2. Uri? url
    )?,
  71. @Deprecated('Use onZoomScaleChanged instead') void androidOnScaleChanged(
    1. InAppWebViewController controller,
    2. double oldScale,
    3. double newScale
    )?,
  72. @Deprecated('Use onJsBeforeUnload instead') Future<JsBeforeUnloadResponse?> androidOnJsBeforeUnload(
    1. InAppWebViewController controller,
    2. JsBeforeUnloadRequest jsBeforeUnloadRequest
    )?,
  73. @Deprecated('Use onReceivedLoginRequest instead') void androidOnReceivedLoginRequest(
    1. InAppWebViewController controller,
    2. LoginRequest loginRequest
    )?,
  74. void onDidReceiveServerRedirectForProvisionalNavigation(
    1. InAppWebViewController controller
    )?,
  75. Future<FormResubmissionAction?> onFormResubmission(
    1. InAppWebViewController controller,
    2. WebUri? url
    )?,
  76. void onGeolocationPermissionsHidePrompt(
    1. InAppWebViewController controller
    )?,
  77. Future<GeolocationPermissionShowPromptResponse?> onGeolocationPermissionsShowPrompt(
    1. InAppWebViewController controller,
    2. String origin
    )?,
  78. Future<JsBeforeUnloadResponse?> onJsBeforeUnload(
    1. InAppWebViewController controller,
    2. JsBeforeUnloadRequest jsBeforeUnloadRequest
    )?,
  79. Future<NavigationResponseAction?> onNavigationResponse(
    1. InAppWebViewController controller,
    2. NavigationResponse navigationResponse
    )?,
  80. Future<PermissionResponse?> onPermissionRequest(
    1. InAppWebViewController controller,
    2. PermissionRequest permissionRequest
    )?,
  81. void onReceivedIcon(
    1. InAppWebViewController controller,
    2. Uint8List icon
    )?,
  82. void onReceivedLoginRequest(
    1. InAppWebViewController controller,
    2. LoginRequest loginRequest
    )?,
  83. void onPermissionRequestCanceled(
    1. InAppWebViewController controller,
    2. PermissionRequest permissionRequest
    )?,
  84. void onRequestFocus(
    1. InAppWebViewController controller
    )?,
  85. void onReceivedTouchIconUrl(
    1. InAppWebViewController controller,
    2. WebUri url,
    3. bool precomposed
    )?,
  86. void onRenderProcessGone(
    1. InAppWebViewController controller,
    2. RenderProcessGoneDetail detail
    )?,
  87. Future<WebViewRenderProcessAction?> onRenderProcessResponsive(
    1. InAppWebViewController controller,
    2. WebUri? url
    )?,
  88. Future<WebViewRenderProcessAction?> onRenderProcessUnresponsive(
    1. InAppWebViewController controller,
    2. WebUri? url
    )?,
  89. Future<SafeBrowsingResponse?> onSafeBrowsingHit(
    1. InAppWebViewController controller,
    2. WebUri url,
    3. SafeBrowsingThreat? threatType
    )?,
  90. void onWebContentProcessDidTerminate(
    1. InAppWebViewController controller
    )?,
  91. Future<ShouldAllowDeprecatedTLSAction?> shouldAllowDeprecatedTLS(
    1. InAppWebViewController controller,
    2. URLAuthenticationChallenge challenge
    )?,
  92. Future<WebResourceResponse?> shouldInterceptRequest(
    1. InAppWebViewController controller,
    2. WebResourceRequest request
    )?,
  93. Future<void> onCameraCaptureStateChanged(
    1. InAppWebViewController controller,
    2. MediaCaptureState? oldState,
    3. MediaCaptureState? newState
    )?,
  94. Future<void> onMicrophoneCaptureStateChanged(
    1. InAppWebViewController controller,
    2. MediaCaptureState? oldState,
    3. MediaCaptureState? newState
    )?,
  95. void onContentSizeChanged(
    1. InAppWebViewController controller,
    2. Size oldContentSize,
    3. Size newContentSize
    )?,
})

Implementation

HeadlessInAppWebView({
  Size initialSize = const Size(-1, -1),
  int? windowId,
  HeadlessInAppWebView? headlessWebView,
  InAppWebViewKeepAlive? keepAlive,
  bool? preventGestureDelay,
  @Deprecated('Use onGeolocationPermissionsHidePrompt instead')
  void Function(InAppWebViewController controller)?
      androidOnGeolocationPermissionsHidePrompt,
  @Deprecated('Use onGeolocationPermissionsShowPrompt instead')
  Future<GeolocationPermissionShowPromptResponse?> Function(
          InAppWebViewController controller, String origin)?
      androidOnGeolocationPermissionsShowPrompt,
  @Deprecated('Use onPermissionRequest instead')
  Future<PermissionRequestResponse?> Function(
          InAppWebViewController controller,
          String origin,
          List<String> resources)?
      androidOnPermissionRequest,
  @Deprecated('Use onSafeBrowsingHit instead')
  Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
          Uri url, SafeBrowsingThreat? threatType)?
      androidOnSafeBrowsingHit,
  InAppWebViewInitialData? initialData,
  String? initialFile,
  @Deprecated('Use initialSettings instead')
  InAppWebViewGroupOptions? initialOptions,
  InAppWebViewSettings? initialSettings,
  URLRequest? initialUrlRequest,
  UnmodifiableListView<UserScript>? initialUserScripts,
  PullToRefreshController? pullToRefreshController,
  FindInteractionController? findInteractionController,
  ContextMenu? contextMenu,
  void Function(InAppWebViewController controller, WebUri? url)?
      onPageCommitVisible,
  void Function(InAppWebViewController controller, String? title)?
      onTitleChanged,
  @Deprecated(
      'Use onDidReceiveServerRedirectForProvisionalNavigation instead')
  void Function(InAppWebViewController controller)?
      iosOnDidReceiveServerRedirectForProvisionalNavigation,
  @Deprecated('Use onWebContentProcessDidTerminate instead')
  void Function(InAppWebViewController controller)?
      iosOnWebContentProcessDidTerminate,
  @Deprecated('Use onNavigationResponse instead')
  Future<IOSNavigationResponseAction?> Function(
          InAppWebViewController controller,
          IOSWKNavigationResponse navigationResponse)?
      iosOnNavigationResponse,
  @Deprecated('Use shouldAllowDeprecatedTLS instead')
  Future<IOSShouldAllowDeprecatedTLSAction?> Function(
          InAppWebViewController controller,
          URLAuthenticationChallenge challenge)?
      iosShouldAllowDeprecatedTLS,
  Future<AjaxRequestAction> Function(
          InAppWebViewController controller, AjaxRequest ajaxRequest)?
      onAjaxProgress,
  Future<AjaxRequestAction?> Function(
          InAppWebViewController controller, AjaxRequest ajaxRequest)?
      onAjaxReadyStateChange,
  void Function(
          InAppWebViewController controller, ConsoleMessage consoleMessage)?
      onConsoleMessage,
  Future<bool?> Function(InAppWebViewController controller,
          CreateWindowAction createWindowAction)?
      onCreateWindow,
  void Function(InAppWebViewController controller)? onCloseWindow,
  void Function(InAppWebViewController controller)? onWindowFocus,
  void Function(InAppWebViewController controller)? onWindowBlur,
  @Deprecated('Use onReceivedIcon instead')
  void Function(InAppWebViewController controller, Uint8List icon)?
      androidOnReceivedIcon,
  @Deprecated('Use onReceivedTouchIconUrl instead')
  void Function(InAppWebViewController controller, Uri url, bool precomposed)?
      androidOnReceivedTouchIconUrl,
  @Deprecated('Use onDownloadStartRequest instead')
  void Function(InAppWebViewController controller, Uri url)? onDownloadStart,
  void Function(InAppWebViewController controller,
          DownloadStartRequest downloadStartRequest)?
      onDownloadStartRequest,
  @Deprecated('Use FindInteractionController.onFindResultReceived instead')
  void Function(InAppWebViewController controller, int activeMatchOrdinal,
          int numberOfMatches, bool isDoneCounting)?
      onFindResultReceived,
  Future<JsAlertResponse?> Function(
          InAppWebViewController controller, JsAlertRequest jsAlertRequest)?
      onJsAlert,
  Future<JsConfirmResponse?> Function(InAppWebViewController controller,
          JsConfirmRequest jsConfirmRequest)?
      onJsConfirm,
  Future<JsPromptResponse?> Function(
          InAppWebViewController controller, JsPromptRequest jsPromptRequest)?
      onJsPrompt,
  @Deprecated("Use onReceivedError instead")
  void Function(InAppWebViewController controller, Uri? url, int code,
          String message)?
      onLoadError,
  void Function(InAppWebViewController controller, WebResourceRequest request,
          WebResourceError error)?
      onReceivedError,
  @Deprecated("Use onReceivedHttpError instead")
  void Function(InAppWebViewController controller, Uri? url, int statusCode,
          String description)?
      onLoadHttpError,
  void Function(InAppWebViewController controller, WebResourceRequest request,
          WebResourceResponse errorResponse)?
      onReceivedHttpError,
  void Function(InAppWebViewController controller, LoadedResource resource)?
      onLoadResource,
  @Deprecated('Use onLoadResourceWithCustomScheme instead')
  Future<CustomSchemeResponse?> Function(
          InAppWebViewController controller, Uri url)?
      onLoadResourceCustomScheme,
  Future<CustomSchemeResponse?> Function(
          InAppWebViewController controller, WebResourceRequest request)?
      onLoadResourceWithCustomScheme,
  void Function(InAppWebViewController controller, WebUri? url)? onLoadStart,
  void Function(InAppWebViewController controller, WebUri? url)? onLoadStop,
  void Function(InAppWebViewController controller,
          InAppWebViewHitTestResult hitTestResult)?
      onLongPressHitTestResult,
  @Deprecated("Use onPrintRequest instead")
  void Function(InAppWebViewController controller, Uri? url)? onPrint,
  Future<bool?> Function(InAppWebViewController controller, WebUri? url,
          PlatformPrintJobController? printJobController)?
      onPrintRequest,
  void Function(InAppWebViewController controller, int progress)?
      onProgressChanged,
  Future<ClientCertResponse?> Function(InAppWebViewController controller,
          URLAuthenticationChallenge challenge)?
      onReceivedClientCertRequest,
  Future<HttpAuthResponse?> Function(InAppWebViewController controller,
          URLAuthenticationChallenge challenge)?
      onReceivedHttpAuthRequest,
  Future<ServerTrustAuthResponse?> Function(InAppWebViewController controller,
          URLAuthenticationChallenge challenge)?
      onReceivedServerTrustAuthRequest,
  void Function(InAppWebViewController controller, int x, int y)?
      onScrollChanged,
  void Function(
          InAppWebViewController controller, WebUri? url, bool? isReload)?
      onUpdateVisitedHistory,
  void Function(InAppWebViewController controller)? onWebViewCreated,
  Future<AjaxRequest?> Function(
          InAppWebViewController controller, AjaxRequest ajaxRequest)?
      shouldInterceptAjaxRequest,
  Future<FetchRequest?> Function(
          InAppWebViewController controller, FetchRequest fetchRequest)?
      shouldInterceptFetchRequest,
  Future<NavigationActionPolicy?> Function(InAppWebViewController controller,
          NavigationAction navigationAction)?
      shouldOverrideUrlLoading,
  void Function(InAppWebViewController controller)? onEnterFullscreen,
  void Function(InAppWebViewController controller)? onExitFullscreen,
  void Function(InAppWebViewController controller, int x, int y,
          bool clampedX, bool clampedY)?
      onOverScrolled,
  void Function(InAppWebViewController controller, double oldScale,
          double newScale)?
      onZoomScaleChanged,
  @Deprecated('Use shouldInterceptRequest instead')
  Future<WebResourceResponse?> Function(
          InAppWebViewController controller, WebResourceRequest request)?
      androidShouldInterceptRequest,
  @Deprecated('Use onRenderProcessUnresponsive instead')
  Future<WebViewRenderProcessAction?> Function(
          InAppWebViewController controller, Uri? url)?
      androidOnRenderProcessUnresponsive,
  @Deprecated('Use onRenderProcessResponsive instead')
  Future<WebViewRenderProcessAction?> Function(
          InAppWebViewController controller, Uri? url)?
      androidOnRenderProcessResponsive,
  @Deprecated('Use onRenderProcessGone instead')
  void Function(
          InAppWebViewController controller, RenderProcessGoneDetail detail)?
      androidOnRenderProcessGone,
  @Deprecated('Use onFormResubmission instead')
  Future<FormResubmissionAction?> Function(
          InAppWebViewController controller, Uri? url)?
      androidOnFormResubmission,
  @Deprecated('Use onZoomScaleChanged instead')
  void Function(InAppWebViewController controller, double oldScale,
          double newScale)?
      androidOnScaleChanged,
  @Deprecated('Use onJsBeforeUnload instead')
  Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller,
          JsBeforeUnloadRequest jsBeforeUnloadRequest)?
      androidOnJsBeforeUnload,
  @Deprecated('Use onReceivedLoginRequest instead')
  void Function(InAppWebViewController controller, LoginRequest loginRequest)?
      androidOnReceivedLoginRequest,
  void Function(InAppWebViewController controller)?
      onDidReceiveServerRedirectForProvisionalNavigation,
  Future<FormResubmissionAction?> Function(
          InAppWebViewController controller, WebUri? url)?
      onFormResubmission,
  void Function(InAppWebViewController controller)?
      onGeolocationPermissionsHidePrompt,
  Future<GeolocationPermissionShowPromptResponse?> Function(
          InAppWebViewController controller, String origin)?
      onGeolocationPermissionsShowPrompt,
  Future<JsBeforeUnloadResponse?> Function(InAppWebViewController controller,
          JsBeforeUnloadRequest jsBeforeUnloadRequest)?
      onJsBeforeUnload,
  Future<NavigationResponseAction?> Function(
          InAppWebViewController controller,
          NavigationResponse navigationResponse)?
      onNavigationResponse,
  Future<PermissionResponse?> Function(InAppWebViewController controller,
          PermissionRequest permissionRequest)?
      onPermissionRequest,
  void Function(InAppWebViewController controller, Uint8List icon)?
      onReceivedIcon,
  void Function(InAppWebViewController controller, LoginRequest loginRequest)?
      onReceivedLoginRequest,
  void Function(InAppWebViewController controller,
          PermissionRequest permissionRequest)?
      onPermissionRequestCanceled,
  void Function(InAppWebViewController controller)? onRequestFocus,
  void Function(
          InAppWebViewController controller, WebUri url, bool precomposed)?
      onReceivedTouchIconUrl,
  void Function(
          InAppWebViewController controller, RenderProcessGoneDetail detail)?
      onRenderProcessGone,
  Future<WebViewRenderProcessAction?> Function(
          InAppWebViewController controller, WebUri? url)?
      onRenderProcessResponsive,
  Future<WebViewRenderProcessAction?> Function(
          InAppWebViewController controller, WebUri? url)?
      onRenderProcessUnresponsive,
  Future<SafeBrowsingResponse?> Function(InAppWebViewController controller,
          WebUri url, SafeBrowsingThreat? threatType)?
      onSafeBrowsingHit,
  void Function(InAppWebViewController controller)?
      onWebContentProcessDidTerminate,
  Future<ShouldAllowDeprecatedTLSAction?> Function(
          InAppWebViewController controller,
          URLAuthenticationChallenge challenge)?
      shouldAllowDeprecatedTLS,
  Future<WebResourceResponse?> Function(
          InAppWebViewController controller, WebResourceRequest request)?
      shouldInterceptRequest,
  Future<void> Function(
    InAppWebViewController controller,
    MediaCaptureState? oldState,
    MediaCaptureState? newState,
  )? onCameraCaptureStateChanged,
  Future<void> Function(
    InAppWebViewController controller,
    MediaCaptureState? oldState,
    MediaCaptureState? newState,
  )? onMicrophoneCaptureStateChanged,
  void Function(InAppWebViewController controller, Size oldContentSize,
          Size newContentSize)?
      onContentSizeChanged,
}) : this.fromPlatformCreationParams(
          params: PlatformHeadlessInAppWebViewCreationParams(
        controllerFromPlatform: (PlatformInAppWebViewController controller) =>
            InAppWebViewController.fromPlatform(platform: controller),
        initialSize: initialSize,
        windowId: windowId,
        initialUrlRequest: initialUrlRequest,
        initialFile: initialFile,
        initialData: initialData,
        initialOptions: initialOptions,
        initialSettings: initialSettings,
        initialUserScripts: initialUserScripts,
        pullToRefreshController: pullToRefreshController?.platform,
        findInteractionController: findInteractionController?.platform,
        contextMenu: contextMenu,
        onWebViewCreated: onWebViewCreated != null
            ? (controller) => onWebViewCreated.call(controller)
            : null,
        onLoadStart: onLoadStart != null
            ? (controller, url) => onLoadStart.call(controller, url)
            : null,
        onLoadStop: onLoadStop != null
            ? (controller, url) => onLoadStop.call(controller, url)
            : null,
        onLoadError: onLoadError != null
            ? (controller, url, code, message) =>
                onLoadError.call(controller, url, code, message)
            : null,
        onReceivedError: onReceivedError != null
            ? (controller, request, error) =>
                onReceivedError.call(controller, request, error)
            : null,
        onLoadHttpError: onLoadHttpError != null
            ? (controller, url, statusCode, description) =>
                onLoadHttpError.call(controller, url, statusCode, description)
            : null,
        onReceivedHttpError: onReceivedHttpError != null
            ? (controller, request, errorResponse) =>
                onReceivedHttpError.call(controller, request, errorResponse)
            : null,
        onConsoleMessage: onConsoleMessage != null
            ? (controller, consoleMessage) =>
                onConsoleMessage.call(controller, consoleMessage)
            : null,
        onProgressChanged: onProgressChanged != null
            ? (controller, progress) =>
                onProgressChanged.call(controller, progress)
            : null,
        shouldOverrideUrlLoading: shouldOverrideUrlLoading != null
            ? (controller, navigationAction) =>
                shouldOverrideUrlLoading(controller, navigationAction)
            : null,
        onLoadResource: onLoadResource != null
            ? (controller, resource) =>
                onLoadResource.call(controller, resource)
            : null,
        onScrollChanged: onScrollChanged != null
            ? (controller, x, y) => onScrollChanged.call(controller, x, y)
            : null,
        onDownloadStart: onDownloadStart != null
            ? (controller, url) => onDownloadStart.call(controller, url)
            : null,
        onDownloadStartRequest: onDownloadStartRequest != null
            ? (controller, downloadStartRequest) =>
                onDownloadStartRequest.call(controller, downloadStartRequest)
            : null,
        onLoadResourceCustomScheme: onLoadResourceCustomScheme != null
            ? (controller, url) =>
                onLoadResourceCustomScheme.call(controller, url)
            : null,
        onLoadResourceWithCustomScheme: onLoadResourceWithCustomScheme != null
            ? (controller, request) =>
                onLoadResourceWithCustomScheme.call(controller, request)
            : null,
        onCreateWindow: onCreateWindow != null
            ? (controller, createWindowAction) =>
                onCreateWindow.call(controller, createWindowAction)
            : null,
        onCloseWindow: onCloseWindow != null
            ? (controller) => onCloseWindow.call(controller)
            : null,
        onJsAlert: onJsAlert != null
            ? (controller, jsAlertRequest) =>
                onJsAlert.call(controller, jsAlertRequest)
            : null,
        onJsConfirm: onJsConfirm != null
            ? (controller, jsConfirmRequest) =>
                onJsConfirm.call(controller, jsConfirmRequest)
            : null,
        onJsPrompt: onJsPrompt != null
            ? (controller, jsPromptRequest) =>
                onJsPrompt.call(controller, jsPromptRequest)
            : null,
        onReceivedHttpAuthRequest: onReceivedHttpAuthRequest != null
            ? (controller, challenge) =>
                onReceivedHttpAuthRequest.call(controller, challenge)
            : null,
        onReceivedServerTrustAuthRequest: onReceivedServerTrustAuthRequest !=
                null
            ? (controller, challenge) =>
                onReceivedServerTrustAuthRequest.call(controller, challenge)
            : null,
        onReceivedClientCertRequest: onReceivedClientCertRequest != null
            ? (controller, challenge) =>
                onReceivedClientCertRequest.call(controller, challenge)
            : null,
        onFindResultReceived: onFindResultReceived != null
            ? (controller, activeMatchOrdinal, numberOfMatches,
                    isDoneCounting) =>
                onFindResultReceived.call(controller, activeMatchOrdinal,
                    numberOfMatches, isDoneCounting)
            : null,
        shouldInterceptAjaxRequest: shouldInterceptAjaxRequest != null
            ? (controller, ajaxRequest) =>
                shouldInterceptAjaxRequest.call(controller, ajaxRequest)
            : null,
        onAjaxReadyStateChange: onAjaxReadyStateChange != null
            ? (controller, ajaxRequest) =>
                onAjaxReadyStateChange.call(controller, ajaxRequest)
            : null,
        onAjaxProgress: onAjaxProgress != null
            ? (controller, ajaxRequest) =>
                onAjaxProgress.call(controller, ajaxRequest)
            : null,
        shouldInterceptFetchRequest: shouldInterceptFetchRequest != null
            ? (controller, fetchRequest) =>
                shouldInterceptFetchRequest.call(controller, fetchRequest)
            : null,
        onUpdateVisitedHistory: onUpdateVisitedHistory != null
            ? (controller, url, isReload) =>
                onUpdateVisitedHistory.call(controller, url, isReload)
            : null,
        onPrint: onPrint != null
            ? (controller, url) => onPrint.call(controller, url)
            : null,
        onPrintRequest: onPrintRequest != null
            ? (controller, url, printJobController) =>
                onPrintRequest.call(controller, url, printJobController)
            : null,
        onLongPressHitTestResult: onLongPressHitTestResult != null
            ? (controller, hitTestResult) =>
                onLongPressHitTestResult.call(controller, hitTestResult)
            : null,
        onEnterFullscreen: onEnterFullscreen != null
            ? (controller) => onEnterFullscreen.call(controller)
            : null,
        onExitFullscreen: onExitFullscreen != null
            ? (controller) => onExitFullscreen.call(controller)
            : null,
        onPageCommitVisible: onPageCommitVisible != null
            ? (controller, url) => onPageCommitVisible.call(controller, url)
            : null,
        onTitleChanged: onTitleChanged != null
            ? (controller, title) => onTitleChanged.call(controller, title)
            : null,
        onWindowFocus: onWindowFocus != null
            ? (controller) => onWindowFocus.call(controller)
            : null,
        onWindowBlur: onWindowBlur != null
            ? (controller) => onWindowBlur.call(controller)
            : null,
        onOverScrolled: onOverScrolled != null
            ? (controller, x, y, clampedX, clampedY) =>
                onOverScrolled.call(controller, x, y, clampedX, clampedY)
            : null,
        onZoomScaleChanged: onZoomScaleChanged != null
            ? (controller, oldScale, newScale) =>
                onZoomScaleChanged.call(controller, oldScale, newScale)
            : null,
        androidOnSafeBrowsingHit: androidOnSafeBrowsingHit != null
            ? (controller, url, threatType) =>
                androidOnSafeBrowsingHit.call(controller, url, threatType)
            : null,
        onSafeBrowsingHit: onSafeBrowsingHit != null
            ? (controller, url, threatType) =>
                onSafeBrowsingHit.call(controller, url, threatType)
            : null,
        androidOnPermissionRequest: androidOnPermissionRequest != null
            ? (controller, origin, resources) =>
                androidOnPermissionRequest.call(controller, origin, resources)
            : null,
        onPermissionRequest: onPermissionRequest != null
            ? (controller, permissionRequest) =>
                onPermissionRequest.call(controller, permissionRequest)
            : null,
        androidOnGeolocationPermissionsShowPrompt:
            androidOnGeolocationPermissionsShowPrompt != null
                ? (controller, origin) =>
                    androidOnGeolocationPermissionsShowPrompt.call(
                        controller, origin)
                : null,
        onGeolocationPermissionsShowPrompt:
            onGeolocationPermissionsShowPrompt != null
                ? (controller, origin) => onGeolocationPermissionsShowPrompt
                    .call(controller, origin)
                : null,
        androidOnGeolocationPermissionsHidePrompt:
            androidOnGeolocationPermissionsHidePrompt != null
                ? (controller) =>
                    androidOnGeolocationPermissionsHidePrompt.call(controller)
                : null,
        onGeolocationPermissionsHidePrompt:
            onGeolocationPermissionsHidePrompt != null
                ? (controller) =>
                    onGeolocationPermissionsHidePrompt.call(controller)
                : null,
        androidShouldInterceptRequest: androidShouldInterceptRequest != null
            ? (controller, request) =>
                androidShouldInterceptRequest.call(controller, request)
            : null,
        shouldInterceptRequest: shouldInterceptRequest != null
            ? (controller, request) =>
                shouldInterceptRequest.call(controller, request)
            : null,
        androidOnRenderProcessGone: androidOnRenderProcessGone != null
            ? (controller, detail) =>
                androidOnRenderProcessGone.call(controller, detail)
            : null,
        onRenderProcessGone: onRenderProcessGone != null
            ? (controller, detail) =>
                onRenderProcessGone.call(controller, detail)
            : null,
        androidOnRenderProcessResponsive:
            androidOnRenderProcessResponsive != null
                ? (controller, url) =>
                    androidOnRenderProcessResponsive.call(controller, url)
                : null,
        onRenderProcessResponsive: onRenderProcessResponsive != null
            ? (controller, url) =>
                onRenderProcessResponsive.call(controller, url)
            : null,
        androidOnRenderProcessUnresponsive:
            androidOnRenderProcessUnresponsive != null
                ? (controller, url) =>
                    androidOnRenderProcessUnresponsive.call(controller, url)
                : null,
        onRenderProcessUnresponsive: onRenderProcessUnresponsive != null
            ? (controller, url) =>
                onRenderProcessUnresponsive.call(controller, url)
            : null,
        androidOnFormResubmission: androidOnFormResubmission != null
            ? (controller, url) =>
                androidOnFormResubmission.call(controller, url)
            : null,
        onFormResubmission: onFormResubmission != null
            ? (controller, url) => onFormResubmission.call(controller, url)
            : null,
        androidOnScaleChanged: androidOnScaleChanged != null
            ? (controller, oldScale, newScale) =>
                androidOnScaleChanged.call(controller, oldScale, newScale)
            : null,
        androidOnReceivedIcon: androidOnReceivedIcon != null
            ? (controller, icon) =>
                androidOnReceivedIcon.call(controller, icon)
            : null,
        onReceivedIcon: onReceivedIcon != null
            ? (controller, icon) => onReceivedIcon.call(controller, icon)
            : null,
        androidOnReceivedTouchIconUrl: androidOnReceivedTouchIconUrl != null
            ? (controller, url, precomposed) => androidOnReceivedTouchIconUrl
                .call(controller, url, precomposed)
            : null,
        onReceivedTouchIconUrl: onReceivedTouchIconUrl != null
            ? (controller, url, precomposed) =>
                onReceivedTouchIconUrl.call(controller, url, precomposed)
            : null,
        androidOnJsBeforeUnload: androidOnJsBeforeUnload != null
            ? (controller, jsBeforeUnloadRequest) => androidOnJsBeforeUnload
                .call(controller, jsBeforeUnloadRequest)
            : null,
        onJsBeforeUnload: onJsBeforeUnload != null
            ? (controller, jsBeforeUnloadRequest) =>
                onJsBeforeUnload.call(controller, jsBeforeUnloadRequest)
            : null,
        androidOnReceivedLoginRequest: androidOnReceivedLoginRequest != null
            ? (controller, loginRequest) =>
                androidOnReceivedLoginRequest.call(controller, loginRequest)
            : null,
        onReceivedLoginRequest: onReceivedLoginRequest != null
            ? (controller, loginRequest) =>
                onReceivedLoginRequest.call(controller, loginRequest)
            : null,
        onPermissionRequestCanceled: onPermissionRequestCanceled != null
            ? (controller, permissionRequest) => onPermissionRequestCanceled
                .call(controller, permissionRequest)
            : null,
        onRequestFocus: onRequestFocus != null
            ? (controller) => onRequestFocus.call(controller)
            : null,
        iosOnWebContentProcessDidTerminate:
            iosOnWebContentProcessDidTerminate != null
                ? (controller) =>
                    iosOnWebContentProcessDidTerminate.call(controller)
                : null,
        onWebContentProcessDidTerminate: onWebContentProcessDidTerminate !=
                null
            ? (controller) => onWebContentProcessDidTerminate.call(controller)
            : null,
        iosOnDidReceiveServerRedirectForProvisionalNavigation:
            iosOnDidReceiveServerRedirectForProvisionalNavigation != null
                ? (controller) =>
                    iosOnDidReceiveServerRedirectForProvisionalNavigation
                        .call(controller)
                : null,
        onDidReceiveServerRedirectForProvisionalNavigation:
            onDidReceiveServerRedirectForProvisionalNavigation != null
                ? (controller) =>
                    onDidReceiveServerRedirectForProvisionalNavigation
                        .call(controller)
                : null,
        iosOnNavigationResponse: iosOnNavigationResponse != null
            ? (controller, navigationResponse) =>
                iosOnNavigationResponse.call(controller, navigationResponse)
            : null,
        onNavigationResponse: onNavigationResponse != null
            ? (controller, navigationResponse) =>
                onNavigationResponse.call(controller, navigationResponse)
            : null,
        iosShouldAllowDeprecatedTLS: iosShouldAllowDeprecatedTLS != null
            ? (controller, challenge) =>
                iosShouldAllowDeprecatedTLS.call(controller, challenge)
            : null,
        shouldAllowDeprecatedTLS: shouldAllowDeprecatedTLS != null
            ? (controller, challenge) =>
                shouldAllowDeprecatedTLS.call(controller, challenge)
            : null,
        onCameraCaptureStateChanged: onCameraCaptureStateChanged != null
            ? (controller, oldState, newState) => onCameraCaptureStateChanged
                .call(controller, oldState, newState)
            : null,
        onMicrophoneCaptureStateChanged:
            onMicrophoneCaptureStateChanged != null
                ? (controller, oldState, newState) =>
                    onMicrophoneCaptureStateChanged.call(
                        controller, oldState, newState)
                : null,
        onContentSizeChanged: onContentSizeChanged != null
            ? (controller, oldContentSize, newContentSize) =>
                onContentSizeChanged.call(
                    controller, oldContentSize, newContentSize)
            : null,
      ));