diff --git a/flutter_inappwebview/CHANGELOG.md b/flutter_inappwebview/CHANGELOG.md index 99966d0d..279fb9b3 100755 --- a/flutter_inappwebview/CHANGELOG.md +++ b/flutter_inappwebview/CHANGELOG.md @@ -1,3 +1,8 @@ +## 6.0.0-beta.31 + +- Updated minimum platform interface and implementation versions +- Fixed events not called on `InAppBrowser` and `ChromeSafariBrowser` opening same instance multiple times + ## 6.0.0-beta.30 - Updated minimum platform interface and implementation versions diff --git a/flutter_inappwebview/lib/src/chrome_safari_browser/chrome_safari_browser.dart b/flutter_inappwebview/lib/src/chrome_safari_browser/chrome_safari_browser.dart index c0ddbe75..24592383 100755 --- a/flutter_inappwebview/lib/src/chrome_safari_browser/chrome_safari_browser.dart +++ b/flutter_inappwebview/lib/src/chrome_safari_browser/chrome_safari_browser.dart @@ -42,13 +42,15 @@ class ChromeSafariBrowser implements PlatformChromeSafariBrowserEvents { @Deprecated('Use settings instead') // ignore: deprecated_member_use_from_same_package ChromeSafariBrowserClassOptions? options, - ChromeSafariBrowserSettings? settings}) => - platform.open( - url: url, - headers: headers, - otherLikelyURLs: otherLikelyURLs, - options: options, - settings: settings); + ChromeSafariBrowserSettings? settings}) { + this.platform.eventHandler = this; + return platform.open( + url: url, + headers: headers, + otherLikelyURLs: otherLikelyURLs, + options: options, + settings: settings); + } ///{@macro flutter_inappwebview_platform_interface.PlatformChromeSafariBrowser.launchUrl} Future launchUrl({ diff --git a/flutter_inappwebview/lib/src/in_app_browser/in_app_browser.dart b/flutter_inappwebview/lib/src/in_app_browser/in_app_browser.dart index eff26809..27ee8682 100755 --- a/flutter_inappwebview/lib/src/in_app_browser/in_app_browser.dart +++ b/flutter_inappwebview/lib/src/in_app_browser/in_app_browser.dart @@ -95,17 +95,21 @@ class InAppBrowser implements PlatformInAppBrowserEvents { Future openUrlRequest( {required URLRequest urlRequest, @Deprecated('Use settings instead') InAppBrowserClassOptions? options, - InAppBrowserClassSettings? settings}) => - platform.openUrlRequest( - urlRequest: urlRequest, options: options, settings: settings); + InAppBrowserClassSettings? settings}) { + this.platform.eventHandler = this; + return platform.openUrlRequest( + urlRequest: urlRequest, options: options, settings: settings); + } ///{@macro flutter_inappwebview_platform_interface.PlatformInAppBrowser.openFile} Future openFile( {required String assetFilePath, @Deprecated('Use settings instead') InAppBrowserClassOptions? options, - InAppBrowserClassSettings? settings}) => - platform.openFile( - assetFilePath: assetFilePath, options: options, settings: settings); + InAppBrowserClassSettings? settings}) { + this.platform.eventHandler = this; + return platform.openFile( + assetFilePath: assetFilePath, options: options, settings: settings); + } ///{@macro flutter_inappwebview_platform_interface.PlatformInAppBrowser.openData} Future openData( @@ -116,16 +120,18 @@ class InAppBrowser implements PlatformInAppBrowserEvents { @Deprecated("Use historyUrl instead") Uri? androidHistoryUrl, WebUri? historyUrl, @Deprecated('Use settings instead') InAppBrowserClassOptions? options, - InAppBrowserClassSettings? settings}) => - platform.openData( - data: data, - mimeType: mimeType, - encoding: encoding, - baseUrl: baseUrl, - androidHistoryUrl: androidHistoryUrl, - historyUrl: historyUrl, - options: options, - settings: settings); + InAppBrowserClassSettings? settings}) { + this.platform.eventHandler = this; + return platform.openData( + data: data, + mimeType: mimeType, + encoding: encoding, + baseUrl: baseUrl, + androidHistoryUrl: androidHistoryUrl, + historyUrl: historyUrl, + options: options, + settings: settings); + } ///{@macro flutter_inappwebview_platform_interface.PlatformInAppBrowser.openWithSystemBrowser} static Future openWithSystemBrowser({required WebUri url}) => diff --git a/flutter_inappwebview/pubspec.yaml b/flutter_inappwebview/pubspec.yaml index 023a7e1c..4b7ea1e4 100755 --- a/flutter_inappwebview/pubspec.yaml +++ b/flutter_inappwebview/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview description: A Flutter plugin that allows you to add an inline webview, to use an headless webview, and to open an in-app browser window. -version: 6.0.0-beta.30 +version: 6.0.0-beta.31 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues @@ -18,11 +18,11 @@ environment: dependencies: flutter: sdk: flutter - flutter_inappwebview_platform_interface: ^1.0.2 - flutter_inappwebview_android: ^1.0.2 - flutter_inappwebview_ios: ^1.0.2 - flutter_inappwebview_macos: ^1.0.1 - flutter_inappwebview_web: ^1.0.1 + flutter_inappwebview_platform_interface: ^1.0.5 + flutter_inappwebview_android: ^1.0.5 + flutter_inappwebview_ios: ^1.0.5 + flutter_inappwebview_macos: ^1.0.2 + flutter_inappwebview_web: ^1.0.2 dev_dependencies: flutter_test: diff --git a/flutter_inappwebview_android/CHANGELOG.md b/flutter_inappwebview_android/CHANGELOG.md index 996839c9..3c73e8c1 100644 --- a/flutter_inappwebview_android/CHANGELOG.md +++ b/flutter_inappwebview_android/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.5 + +- Call `super.dispose();` on `InAppBrowser` and `ChromeSafari` implementations + ## 1.0.4 - Throw platform exception when ProcessGlobalConfig.apply throws an error on the native side to be able to catch it on Flutter side diff --git a/flutter_inappwebview_android/example/pubspec.lock b/flutter_inappwebview_android/example/pubspec.lock index fabbab22..d14b714c 100644 --- a/flutter_inappwebview_android/example/pubspec.lock +++ b/flutter_inappwebview_android/example/pubspec.lock @@ -81,7 +81,7 @@ packages: path: ".." relative: true source: path - version: "1.0.2" + version: "1.0.4" flutter_inappwebview_internal_annotations: dependency: transitive description: @@ -93,11 +93,10 @@ packages: flutter_inappwebview_platform_interface: dependency: transitive description: - name: flutter_inappwebview_platform_interface - sha256: "14e7a7fb25fde02e753ed8fd5276f3b8a49f6e7ee2867c20d02ceef9e3091542" - url: "https://pub.dev" - source: hosted - version: "1.0.2" + path: "../../flutter_inappwebview_platform_interface" + relative: true + source: path + version: "1.0.4" flutter_lints: dependency: "direct dev" description: diff --git a/flutter_inappwebview_android/lib/src/chrome_safari_browser/chrome_safari_browser.dart b/flutter_inappwebview_android/lib/src/chrome_safari_browser/chrome_safari_browser.dart index 8c2b008f..18336a4f 100755 --- a/flutter_inappwebview_android/lib/src/chrome_safari_browser/chrome_safari_browser.dart +++ b/flutter_inappwebview_android/lib/src/chrome_safari_browser/chrome_safari_browser.dart @@ -370,7 +370,7 @@ class AndroidChromeSafariBrowser extends PlatformChromeSafariBrowser @override @mustCallSuper void dispose() { + super.dispose(); disposeChannel(); - eventHandler = null; } } diff --git a/flutter_inappwebview_android/lib/src/in_app_browser/in_app_browser.dart b/flutter_inappwebview_android/lib/src/in_app_browser/in_app_browser.dart index b625f5fa..1c317c65 100755 --- a/flutter_inappwebview_android/lib/src/in_app_browser/in_app_browser.dart +++ b/flutter_inappwebview_android/lib/src/in_app_browser/in_app_browser.dart @@ -359,12 +359,12 @@ class AndroidInAppBrowser extends PlatformInAppBrowser with ChannelController { @override @mustCallSuper void dispose() { + super.dispose(); disposeChannel(); _webViewController?.dispose(); _webViewController = null; pullToRefreshController?.dispose(); findInteractionController?.dispose(); - eventHandler = null; } } diff --git a/flutter_inappwebview_android/pubspec.yaml b/flutter_inappwebview_android/pubspec.yaml index 7782e829..8d9c7f69 100644 --- a/flutter_inappwebview_android/pubspec.yaml +++ b/flutter_inappwebview_android/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview_android description: Android implementation of the flutter_inappwebview plugin. -version: 1.0.4 +version: 1.0.5 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_android issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues @@ -18,7 +18,7 @@ environment: dependencies: flutter: sdk: flutter - flutter_inappwebview_platform_interface: ^1.0.2 + flutter_inappwebview_platform_interface: ^1.0.5 dev_dependencies: flutter_test: diff --git a/flutter_inappwebview_ios/CHANGELOG.md b/flutter_inappwebview_ios/CHANGELOG.md index 18749fbb..4570737d 100644 --- a/flutter_inappwebview_ios/CHANGELOG.md +++ b/flutter_inappwebview_ios/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.5 + +- Call `super.dispose();` on `InAppBrowser` and `ChromeSafari` implementations + ## 1.0.4 - Fixed "Cloudflare Turnstile failure" [#1738](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1738) diff --git a/flutter_inappwebview_ios/lib/src/chrome_safari_browser/chrome_safari_browser.dart b/flutter_inappwebview_ios/lib/src/chrome_safari_browser/chrome_safari_browser.dart index 1ea31618..80b5933b 100755 --- a/flutter_inappwebview_ios/lib/src/chrome_safari_browser/chrome_safari_browser.dart +++ b/flutter_inappwebview_ios/lib/src/chrome_safari_browser/chrome_safari_browser.dart @@ -212,7 +212,7 @@ class IOSChromeSafariBrowser extends PlatformChromeSafariBrowser @override @mustCallSuper void dispose() { + super.dispose(); disposeChannel(); - eventHandler = null; } } diff --git a/flutter_inappwebview_ios/lib/src/in_app_browser/in_app_browser.dart b/flutter_inappwebview_ios/lib/src/in_app_browser/in_app_browser.dart index 1971b4e7..e8da5864 100755 --- a/flutter_inappwebview_ios/lib/src/in_app_browser/in_app_browser.dart +++ b/flutter_inappwebview_ios/lib/src/in_app_browser/in_app_browser.dart @@ -358,12 +358,12 @@ class IOSInAppBrowser extends PlatformInAppBrowser with ChannelController { @override @mustCallSuper void dispose() { + super.dispose(); disposeChannel(); _webViewController?.dispose(); _webViewController = null; pullToRefreshController?.dispose(); findInteractionController?.dispose(); - eventHandler = null; } } diff --git a/flutter_inappwebview_ios/pubspec.yaml b/flutter_inappwebview_ios/pubspec.yaml index c090632e..4bc8f33e 100644 --- a/flutter_inappwebview_ios/pubspec.yaml +++ b/flutter_inappwebview_ios/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview_ios description: iOS implementation of the flutter_inappwebview plugin. -version: 1.0.4 +version: 1.0.5 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_ios issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues @@ -18,7 +18,7 @@ environment: dependencies: flutter: sdk: flutter - flutter_inappwebview_platform_interface: ^1.0.2 + flutter_inappwebview_platform_interface: ^1.0.5 dev_dependencies: flutter_test: diff --git a/flutter_inappwebview_macos/CHANGELOG.md b/flutter_inappwebview_macos/CHANGELOG.md index e7ecf7a2..d8837312 100644 --- a/flutter_inappwebview_macos/CHANGELOG.md +++ b/flutter_inappwebview_macos/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.3 + +- Call `super.dispose();` on `InAppBrowser` implementation + ## 1.0.2 - Fixed "Cloudflare Turnstile failure" [#1738](https://github.com/pichillilorenzo/flutter_inappwebview/issues/1738) diff --git a/flutter_inappwebview_macos/lib/src/in_app_browser/in_app_browser.dart b/flutter_inappwebview_macos/lib/src/in_app_browser/in_app_browser.dart index 2a61f4f9..f6f6f18a 100755 --- a/flutter_inappwebview_macos/lib/src/in_app_browser/in_app_browser.dart +++ b/flutter_inappwebview_macos/lib/src/in_app_browser/in_app_browser.dart @@ -353,12 +353,12 @@ class MacOSInAppBrowser extends PlatformInAppBrowser with ChannelController { @override @mustCallSuper void dispose() { + super.dispose(); disposeChannel(); _webViewController?.dispose(); _webViewController = null; pullToRefreshController?.dispose(); findInteractionController?.dispose(); - eventHandler = null; } } diff --git a/flutter_inappwebview_macos/pubspec.yaml b/flutter_inappwebview_macos/pubspec.yaml index 5a6b62af..c4e72d3b 100644 --- a/flutter_inappwebview_macos/pubspec.yaml +++ b/flutter_inappwebview_macos/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview_macos description: macOS implementation of the flutter_inappwebview plugin. -version: 1.0.2 +version: 1.0.3 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_macos issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues @@ -18,7 +18,7 @@ environment: dependencies: flutter: sdk: flutter - flutter_inappwebview_platform_interface: ^1.0.2 + flutter_inappwebview_platform_interface: ^1.0.5 dev_dependencies: flutter_test: diff --git a/flutter_inappwebview_platform_interface/CHANGELOG.md b/flutter_inappwebview_platform_interface/CHANGELOG.md index ab990590..2f6290ae 100644 --- a/flutter_inappwebview_platform_interface/CHANGELOG.md +++ b/flutter_inappwebview_platform_interface/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.5 + +- Must call super `dispose` method for `PlatformInAppBrowser` and `PlatformChromeSafariBrowser` + ## 1.0.4 - Expose missing `InAppBrowserSettings.menuButtonColor` option diff --git a/flutter_inappwebview_platform_interface/lib/src/chrome_safari_browser/platform_chrome_safari_browser.dart b/flutter_inappwebview_platform_interface/lib/src/chrome_safari_browser/platform_chrome_safari_browser.dart index c221d1cd..13ec3431 100755 --- a/flutter_inappwebview_platform_interface/lib/src/chrome_safari_browser/platform_chrome_safari_browser.dart +++ b/flutter_inappwebview_platform_interface/lib/src/chrome_safari_browser/platform_chrome_safari_browser.dart @@ -466,9 +466,9 @@ abstract class PlatformChromeSafariBrowser extends PlatformInterface ///Disposes the channel and event handler. ///{@endtemplate} @override + @mustCallSuper void dispose() { - throw UnimplementedError( - 'dispose is not implemented on the current platform'); + eventHandler = null; } } diff --git a/flutter_inappwebview_platform_interface/lib/src/in_app_browser/platform_in_app_browser.dart b/flutter_inappwebview_platform_interface/lib/src/in_app_browser/platform_in_app_browser.dart index ae8f8860..45921073 100755 --- a/flutter_inappwebview_platform_interface/lib/src/in_app_browser/platform_in_app_browser.dart +++ b/flutter_inappwebview_platform_interface/lib/src/in_app_browser/platform_in_app_browser.dart @@ -474,9 +474,9 @@ abstract class PlatformInAppBrowser extends PlatformInterface ///Disposes the channel and controllers. ///{@endtemplate} @override + @mustCallSuper void dispose() { - throw UnimplementedError( - 'dispose is not implemented on the current platform'); + eventHandler = null; } } diff --git a/flutter_inappwebview_platform_interface/pubspec.yaml b/flutter_inappwebview_platform_interface/pubspec.yaml index f9f5c297..9a043901 100644 --- a/flutter_inappwebview_platform_interface/pubspec.yaml +++ b/flutter_inappwebview_platform_interface/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview_platform_interface description: A common platform interface for the flutter_inappwebview plugin. -version: 1.0.4 +version: 1.0.5 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_platform_interface issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues diff --git a/flutter_inappwebview_web/CHANGELOG.md b/flutter_inappwebview_web/CHANGELOG.md index b4685c54..32cdbe53 100644 --- a/flutter_inappwebview_web/CHANGELOG.md +++ b/flutter_inappwebview_web/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.2 + +- Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.5` + ## 1.0.1 - Updated `flutter_inappwebview_platform_interface` version dependency to `1.0.2` diff --git a/flutter_inappwebview_web/pubspec.yaml b/flutter_inappwebview_web/pubspec.yaml index 238f89ee..1e0119e9 100644 --- a/flutter_inappwebview_web/pubspec.yaml +++ b/flutter_inappwebview_web/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_inappwebview_web description: Web implementation of the flutter_inappwebview plugin. -version: 1.0.1 +version: 1.0.2 homepage: https://inappwebview.dev/ repository: https://github.com/pichillilorenzo/flutter_inappwebview/tree/master/flutter_inappwebview_web issue_tracker: https://github.com/pichillilorenzo/flutter_inappwebview/issues @@ -21,7 +21,7 @@ dependencies: flutter_web_plugins: sdk: flutter js: ^0.6.4 - flutter_inappwebview_platform_interface: ^1.0.2 + flutter_inappwebview_platform_interface: ^1.0.5 dev_dependencies: flutter_test: