@@ -350,6 +350,8 @@ class WKHttpCookieStore extends NSObject {
350350class WKScriptMessageHandler extends NSObject {
351351 /// Constructs a [WKScriptMessageHandler] .
352352 WKScriptMessageHandler ({
353+ required this .didReceiveScriptMessage,
354+ super .observeValue,
353355 BinaryMessenger ? binaryMessenger,
354356 InstanceManager ? instanceManager,
355357 }) : _scriptMessageHandlerApi = WKScriptMessageHandlerHostApiImpl (
@@ -366,15 +368,10 @@ class WKScriptMessageHandler extends NSObject {
366368 /// Use this method to respond to a message sent from the webpage’s
367369 /// JavaScript code. Use the [message] parameter to get the message contents and
368370 /// to determine the originating web view.
369- Future <void > setDidReceiveScriptMessage (
370- void Function (
371- WKUserContentController userContentController,
372- WKScriptMessage message,
373- )?
374- didReceiveScriptMessage,
375- ) {
376- throw UnimplementedError ();
377- }
371+ final void Function (
372+ WKUserContentController userContentController,
373+ WKScriptMessage message,
374+ ) didReceiveScriptMessage;
378375}
379376
380377/// Manages interactions between JavaScript code and your web view.
@@ -572,6 +569,8 @@ class WKWebViewConfiguration extends NSObject {
572569class WKUIDelegate extends NSObject {
573570 /// Constructs a [WKUIDelegate] .
574571 WKUIDelegate ({
572+ this .onCreateWebView,
573+ super .observeValue,
575574 BinaryMessenger ? binaryMessenger,
576575 InstanceManager ? instanceManager,
577576 }) : _uiDelegateApi = WKUIDelegateHostApiImpl (
@@ -584,15 +583,10 @@ class WKUIDelegate extends NSObject {
584583 final WKUIDelegateHostApiImpl _uiDelegateApi;
585584
586585 /// Indicates a new [WKWebView] was requested to be created with [configuration] .
587- Future <void > setOnCreateWebView (
588- void Function (
589- WKWebViewConfiguration configuration,
590- WKNavigationAction navigationAction,
591- )?
592- onCreateWebView,
593- ) {
594- throw UnimplementedError ();
595- }
586+ final void Function (
587+ WKWebViewConfiguration configuration,
588+ WKNavigationAction navigationAction,
589+ )? onCreateWebView;
596590}
597591
598592/// Methods for handling navigation changes and tracking navigation requests.
@@ -606,6 +600,12 @@ class WKNavigationDelegate extends NSObject {
606600 /// Constructs a [WKNavigationDelegate] .
607601 WKNavigationDelegate ({
608602 this .didFinishNavigation,
603+ this .didStartProvisionalNavigation,
604+ this .decidePolicyForNavigationAction,
605+ this .didFailNavigation,
606+ this .didFailProvisionalNavigation,
607+ this .webViewWebContentProcessDidTerminate,
608+ super .observeValue,
609609 super .binaryMessenger,
610610 super .instanceManager,
611611 }) : _navigationDelegateApi = WKNavigationDelegateHostApiImpl (
@@ -623,6 +623,12 @@ class WKNavigationDelegate extends NSObject {
623623 /// library or to create a copy for an InstanceManager.
624624 WKNavigationDelegate .detached ({
625625 this .didFinishNavigation,
626+ this .didStartProvisionalNavigation,
627+ this .decidePolicyForNavigationAction,
628+ this .didFailNavigation,
629+ this .didFailProvisionalNavigation,
630+ this .webViewWebContentProcessDidTerminate,
631+ super .observeValue,
626632 super .binaryMessenger,
627633 super .instanceManager,
628634 }) : _navigationDelegateApi = WKNavigationDelegateHostApiImpl (
@@ -636,49 +642,36 @@ class WKNavigationDelegate extends NSObject {
636642 final void Function (WKWebView webView, String ? url)? didFinishNavigation;
637643
638644 /// Called when navigation from the main frame has started.
639- Future <void > setDidStartProvisionalNavigation (
640- void Function (WKWebView webView, String ? url)?
641- didStartProvisionalNavigation,
642- ) {
643- throw UnimplementedError ();
644- }
645+ final void Function (WKWebView webView, String ? url)?
646+ didStartProvisionalNavigation;
645647
646648 /// Called when permission is needed to navigate to new content.
647- Future <void > setDecidePolicyForNavigationAction (
648- Future <WKNavigationActionPolicy > Function (
649+ final Future <WKNavigationActionPolicy > Function (
649650 WKWebView webView,
650651 WKNavigationAction navigationAction,
651- )?
652- decidePolicyForNavigationAction) {
653- throw UnimplementedError ();
654- }
652+ )? decidePolicyForNavigationAction;
655653
656654 /// Called when an error occurred during navigation.
657- Future <void > setDidFailNavigation (
658- void Function (WKWebView webView, NSError error)? didFailNavigation,
659- ) {
660- throw UnimplementedError ();
661- }
655+ final void Function (WKWebView webView, NSError error)? didFailNavigation;
662656
663657 /// Called when an error occurred during the early navigation process.
664- Future <void > setDidFailProvisionalNavigation (
665- void Function (WKWebView webView, NSError error)?
666- didFailProvisionalNavigation,
667- ) {
668- throw UnimplementedError ();
669- }
658+ final void Function (WKWebView webView, NSError error)?
659+ didFailProvisionalNavigation;
670660
671661 /// Called when the web view’s content process was terminated.
672- Future <void > setWebViewWebContentProcessDidTerminate (
673- void Function (WKWebView webView)? webViewWebContentProcessDidTerminate,
674- ) {
675- throw UnimplementedError ();
676- }
662+ final void Function (WKWebView webView)? webViewWebContentProcessDidTerminate;
677663
678664 @override
679665 Copyable copy () {
680666 return WKNavigationDelegate .detached (
681667 didFinishNavigation: didFinishNavigation,
668+ didStartProvisionalNavigation: didStartProvisionalNavigation,
669+ decidePolicyForNavigationAction: decidePolicyForNavigationAction,
670+ didFailNavigation: didFailNavigation,
671+ didFailProvisionalNavigation: didFailProvisionalNavigation,
672+ webViewWebContentProcessDidTerminate:
673+ webViewWebContentProcessDidTerminate,
674+ observeValue: observeValue,
682675 binaryMessenger: _navigationDelegateApi.binaryMessenger,
683676 instanceManager: _navigationDelegateApi.instanceManager,
684677 );
@@ -715,6 +708,7 @@ class WKWebView extends UIView {
715708 /// configuration object.
716709 WKWebView (
717710 WKWebViewConfiguration configuration, {
711+ super .observeValue,
718712 super .binaryMessenger,
719713 super .instanceManager,
720714 }) : _binaryMessenger = binaryMessenger,
0 commit comments