commit | 9342f5e99081876615e4727fa441c7a9ffea9eb3 | [log] [tgz] |
---|---|---|
author | Maurice Parrish <10687576+bparrishMines@users.noreply.github.com> | Tue Apr 18 15:18:08 2023 -0400 |
committer | GitHub <noreply@github.com> | Tue Apr 18 19:18:08 2023 +0000 |
tree | 8d8f75cdce1ec96ed5e0d061bc7c4583330457b7 | |
parent | 37adba785644cf6fe8aca32e0333c69ad3b1cdd2 [diff] |
[webview_flutter] Adds support to listen to url changes (#3313) Transfer of https://github.com/flutter/plugins/pull/7113 (All the comments of that PR have been addressed in this one) This PR follows the procedure for changing federated plugins: https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins ~~This is the aggregate solution for https://github.com/flutter/flutter/issues/27729 and is NOT intended to be submitted. This will be split into PRs for each package after approval of this PR.~~ All split PRs have been merged. This adds the `PlatformNavigationDelegate.setOnUrlChange(UrlChange)` method to track url changes. Android adds support for this with the [WebViewClient.doUpdateVisitedHistory](https://developer.android.com/reference/android/webkit/WebViewClient#doUpdateVisitedHistory(android.webkit.WebView,%20java.lang.String,%20boolean)) iOS adds support by observing the value [WKWebView.URL](https://developer.apple.com/documentation/webkit/wkwebview/1415005-url?language=objc). Since the WKWebView.URL would pass back an [NSURL](https://developer.apple.com/documentation/foundation/nsurl?language=objc) to the [observeValue](https://developer.apple.com/documentation/objectivec/nsobject/1416553-observevalueforkeypath?language=objc) callback, the `observeValue` callback would need to distinguish the difference when returning an `int` or an identifier. So the `ObjectOrIdentifier` data class was created to handle this. Alternatives considered: * Convert `NSURL `to an `NSString`. This would work for this situation, but wouldn't work for a class that can't be easily converted to a `String`. * Create a separate `observeValue `callback method for returning an identifier. Potentially named `observeIdentifier`. This doesn't work for returning a list of Objects. Fixes https://github.com/flutter/flutter/issues/27729
This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages
directory to see all packages.
These packages are also available on pub.
Please file any issues, bugs, or feature requests in the main flutter repo. Issues pertaining to this repository are labeled “package”.
If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.
If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.
These are the packages hosted in this repository: