-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[webview_flutter_wkwebview] Change callback methods with a non-null return type to non-null #8564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
beb7539
cf27f9d
0910d57
9442ba7
5353741
f9e6b6d
a072e89
fe2784a
cd912dc
1654755
dbe3fee
2ea1d4c
d989135
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| // Copyright 2013 The Flutter Authors. All rights reserved. | ||
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
| // Autogenerated from Pigeon (v22.7.2), do not edit directly. | ||
| // Autogenerated from Pigeon (v24.0.0), do not edit directly. | ||
| // See also: https://pub.dev/packages/pigeon | ||
|
|
||
| import Foundation | ||
|
|
@@ -23,9 +23,9 @@ import WebKit | |
| final class PigeonError: Error { | ||
| let code: String | ||
| let message: String? | ||
| let details: Any? | ||
| let details: Sendable? | ||
|
|
||
| init(code: String, message: String?, details: Any?) { | ||
| init(code: String, message: String?, details: Sendable?) { | ||
| self.code = code | ||
| self.message = message | ||
| self.details = details | ||
|
|
@@ -4025,28 +4025,9 @@ final class PigeonApiWKNavigationDelegate: PigeonApiProtocolWKNavigationDelegate | |
| completion(.success(Void())) | ||
| return | ||
| } | ||
| let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( | ||
| pigeonInstance as AnyObject) | ||
| let binaryMessenger = pigeonRegistrar.binaryMessenger | ||
| let codec = pigeonRegistrar.codec | ||
| let channelName: String = | ||
| "dev.flutter.pigeon.webview_flutter_wkwebview.WKNavigationDelegate.pigeon_newInstance" | ||
| let channel = FlutterBasicMessageChannel( | ||
| name: channelName, binaryMessenger: binaryMessenger, codec: codec) | ||
| channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in | ||
| guard let listResponse = response as? [Any?] else { | ||
| completion(.failure(createConnectionError(withChannelName: channelName))) | ||
| return | ||
| } | ||
| if listResponse.count > 1 { | ||
| let code: String = listResponse[0] as! String | ||
| let message: String? = nilOrValue(listResponse[1]) | ||
| let details: String? = nilOrValue(listResponse[2]) | ||
| completion(.failure(PigeonError(code: code, message: message, details: details))) | ||
| } else { | ||
| completion(.success(Void())) | ||
| } | ||
| } | ||
| print( | ||
| "Error: Attempting to create a new Dart instance of WKNavigationDelegate, but the class has a nonnull callback method." | ||
| ) | ||
| } | ||
| /// Tells the delegate that navigation is complete. | ||
| func didFinishNavigation( | ||
|
|
@@ -5978,28 +5959,9 @@ final class PigeonApiWKUIDelegate: PigeonApiProtocolWKUIDelegate { | |
| completion(.success(Void())) | ||
| return | ||
| } | ||
| let pigeonIdentifierArg = pigeonRegistrar.instanceManager.addHostCreatedInstance( | ||
| pigeonInstance as AnyObject) | ||
| let binaryMessenger = pigeonRegistrar.binaryMessenger | ||
| let codec = pigeonRegistrar.codec | ||
| let channelName: String = | ||
| "dev.flutter.pigeon.webview_flutter_wkwebview.WKUIDelegate.pigeon_newInstance" | ||
| let channel = FlutterBasicMessageChannel( | ||
| name: channelName, binaryMessenger: binaryMessenger, codec: codec) | ||
| channel.sendMessage([pigeonIdentifierArg] as [Any?]) { response in | ||
| guard let listResponse = response as? [Any?] else { | ||
| completion(.failure(createConnectionError(withChannelName: channelName))) | ||
| return | ||
| } | ||
| if listResponse.count > 1 { | ||
| let code: String = listResponse[0] as! String | ||
| let message: String? = nilOrValue(listResponse[1]) | ||
| let details: String? = nilOrValue(listResponse[2]) | ||
| completion(.failure(PigeonError(code: code, message: message, details: details))) | ||
| } else { | ||
| completion(.success(Void())) | ||
| } | ||
| } | ||
| print( | ||
|
||
| "Error: Attempting to create a new Dart instance of WKUIDelegate, but the class has a nonnull callback method." | ||
| ) | ||
| } | ||
| /// Creates a new web view. | ||
| func onCreateWebView( | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would mention that this fixes a crash, since that's the client-visible effect of the change.