onAjaxReadyStateChange property Null safety

(Future<AjaxRequestAction?> Function?(InAppWebViewController controller, AjaxRequest ajaxRequest)?) onAjaxReadyStateChange
final

Event fired whenever the readyState attribute of an XMLHttpRequest changes. It gives the host application a chance to abort the request.

ajaxRequest represents the XMLHttpRequest.

NOTE: In order to be able to listen this event, you need to set InAppWebViewOptions.useShouldInterceptAjaxRequest option to true. Also, unlike iOS that has WKUserScript that can inject javascript code right after the document element is created but before any other content is loaded, in Android the javascript code used to intercept ajax requests is loaded as soon as possible so it won't be instantaneous as iOS but just after some milliseconds (< ~100ms). Inside the window.addEventListener("flutterInAppWebViewPlatformReady") event, the ajax requests will be intercept for sure.

Implementation

final Future<AjaxRequestAction?> Function(
        InAppWebViewController controller, AjaxRequest ajaxRequest)?
    onAjaxReadyStateChange;