-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[webview_flutter] Add onUrlChanged callback to platform interface. #4509
[webview_flutter] Add onUrlChanged callback to platform interface. #4509
Conversation
mvanbeusekom
left a comment
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.
LGTM with one small nit.
...lutter_platform_interface/lib/src/platform_interface/webview_platform_callbacks_handler.dart
Outdated
Show resolved
Hide resolved
…b/src/platform_interface/webview_platform_callbacks_handler.dart Co-authored-by: Maurits van Beusekom <[email protected]>
|
This pull request is not suitable for automatic merging in its current state.
|
|
This was a breaking change :( Because implementations use |
…face. (flutter#4509)" This reverts commit 349a858.
I was not aware this would lead to a breaking change, absolutely my bad. |
Reverts #4509, which is ecosystem-breaking since it adds a new method to the interface that no existing code implements. Note that while this PR is technically a breaking change, it is deliberately versioned as a non-breaking change so that people will automatically pick up the fix for the previous accidentally-breaking change. (In practice, this revert would only breaking if someone implemented this new method in an unendorsed webview implementation sometime in the last ~12 hours that the change was live).
Yes, this is a structural issue in our CI; we need to implement flutter/flutter#89862 |
This interface is "internal" to the implementations (i.e., it's not something that clients of the app-facing package would implement), right? If so, the non-breaking change would likely be something like:
Then the implementations can implement the new version of build to wire things up using that new object, and the app-facing package can switch to calling the new build instead of the old one. It's not great from an API perspective, but if that's contained to the implementing packages it's livable. |
|
@stuartmorgan The problem I'm running into with this solution is that the WebViewCupertino and WebViewAndroid classes from the native packages both |
Well that's not good. I'll need to take a look in detail at the class structure here and see if there's a point where we could set up a new opt-in path, or if we're stuck doing a breaking change to fix the overuse of |
Reverts flutter#4509, which is ecosystem-breaking since it adds a new method to the interface that no existing code implements. Note that while this PR is technically a breaking change, it is deliberately versioned as a non-breaking change so that people will automatically pick up the fix for the previous accidentally-breaking change. (In practice, this revert would only breaking if someone implemented this new method in an unendorsed webview implementation sometime in the last ~12 hours that the change was live).
Reverts flutter#4509, which is ecosystem-breaking since it adds a new method to the interface that no existing code implements. Note that while this PR is technically a breaking change, it is deliberately versioned as a non-breaking change so that people will automatically pick up the fix for the previous accidentally-breaking change. (In practice, this revert would only breaking if someone implemented this new method in an unendorsed webview implementation sometime in the last ~12 hours that the change was live).
This PR adds a
onUrlChangedevent to the platform interface that is supposed to be fired whenever the url for a webview changes. In contrast to the already existingonPageStarted,onProgress, andonPageFinishedevents,onUrlChangedalso fires for url changes without a full page load, like when navigating around in a single page application.Relevant issue:
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the [pub versioning philosophy], or this PR is [exempt from version changes].CHANGELOG.mdto add a description of the change.///).