@@ -350,6 +350,8 @@ class WKHttpCookieStore extends NSObject {
350
350
class WKScriptMessageHandler extends NSObject {
351
351
/// Constructs a [WKScriptMessageHandler] .
352
352
WKScriptMessageHandler ({
353
+ required this .didReceiveScriptMessage,
354
+ super .observeValue,
353
355
BinaryMessenger ? binaryMessenger,
354
356
InstanceManager ? instanceManager,
355
357
}) : _scriptMessageHandlerApi = WKScriptMessageHandlerHostApiImpl (
@@ -366,15 +368,10 @@ class WKScriptMessageHandler extends NSObject {
366
368
/// Use this method to respond to a message sent from the webpage’s
367
369
/// JavaScript code. Use the [message] parameter to get the message contents and
368
370
/// 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;
378
375
}
379
376
380
377
/// Manages interactions between JavaScript code and your web view.
@@ -572,6 +569,8 @@ class WKWebViewConfiguration extends NSObject {
572
569
class WKUIDelegate extends NSObject {
573
570
/// Constructs a [WKUIDelegate] .
574
571
WKUIDelegate ({
572
+ this .onCreateWebView,
573
+ super .observeValue,
575
574
BinaryMessenger ? binaryMessenger,
576
575
InstanceManager ? instanceManager,
577
576
}) : _uiDelegateApi = WKUIDelegateHostApiImpl (
@@ -584,15 +583,10 @@ class WKUIDelegate extends NSObject {
584
583
final WKUIDelegateHostApiImpl _uiDelegateApi;
585
584
586
585
/// 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;
596
590
}
597
591
598
592
/// Methods for handling navigation changes and tracking navigation requests.
@@ -606,6 +600,12 @@ class WKNavigationDelegate extends NSObject {
606
600
/// Constructs a [WKNavigationDelegate] .
607
601
WKNavigationDelegate ({
608
602
this .didFinishNavigation,
603
+ this .didStartProvisionalNavigation,
604
+ this .decidePolicyForNavigationAction,
605
+ this .didFailNavigation,
606
+ this .didFailProvisionalNavigation,
607
+ this .webViewWebContentProcessDidTerminate,
608
+ super .observeValue,
609
609
super .binaryMessenger,
610
610
super .instanceManager,
611
611
}) : _navigationDelegateApi = WKNavigationDelegateHostApiImpl (
@@ -623,6 +623,12 @@ class WKNavigationDelegate extends NSObject {
623
623
/// library or to create a copy for an InstanceManager.
624
624
WKNavigationDelegate .detached ({
625
625
this .didFinishNavigation,
626
+ this .didStartProvisionalNavigation,
627
+ this .decidePolicyForNavigationAction,
628
+ this .didFailNavigation,
629
+ this .didFailProvisionalNavigation,
630
+ this .webViewWebContentProcessDidTerminate,
631
+ super .observeValue,
626
632
super .binaryMessenger,
627
633
super .instanceManager,
628
634
}) : _navigationDelegateApi = WKNavigationDelegateHostApiImpl (
@@ -636,49 +642,36 @@ class WKNavigationDelegate extends NSObject {
636
642
final void Function (WKWebView webView, String ? url)? didFinishNavigation;
637
643
638
644
/// 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;
645
647
646
648
/// Called when permission is needed to navigate to new content.
647
- Future <void > setDecidePolicyForNavigationAction (
648
- Future <WKNavigationActionPolicy > Function (
649
+ final Future <WKNavigationActionPolicy > Function (
649
650
WKWebView webView,
650
651
WKNavigationAction navigationAction,
651
- )?
652
- decidePolicyForNavigationAction) {
653
- throw UnimplementedError ();
654
- }
652
+ )? decidePolicyForNavigationAction;
655
653
656
654
/// 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;
662
656
663
657
/// 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;
670
660
671
661
/// 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;
677
663
678
664
@override
679
665
Copyable copy () {
680
666
return WKNavigationDelegate .detached (
681
667
didFinishNavigation: didFinishNavigation,
668
+ didStartProvisionalNavigation: didStartProvisionalNavigation,
669
+ decidePolicyForNavigationAction: decidePolicyForNavigationAction,
670
+ didFailNavigation: didFailNavigation,
671
+ didFailProvisionalNavigation: didFailProvisionalNavigation,
672
+ webViewWebContentProcessDidTerminate:
673
+ webViewWebContentProcessDidTerminate,
674
+ observeValue: observeValue,
682
675
binaryMessenger: _navigationDelegateApi.binaryMessenger,
683
676
instanceManager: _navigationDelegateApi.instanceManager,
684
677
);
@@ -715,6 +708,7 @@ class WKWebView extends UIView {
715
708
/// configuration object.
716
709
WKWebView (
717
710
WKWebViewConfiguration configuration, {
711
+ super .observeValue,
718
712
super .binaryMessenger,
719
713
super .instanceManager,
720
714
}) : _binaryMessenger = binaryMessenger,
0 commit comments