diff --git a/CHANGELOG.md b/CHANGELOG.md index f09013d5..78122685 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 6.1.0-beta.1 + +### BREAKING CHANGES + +Plugin conversion to a [Federated Plugin](https://docs.flutter.dev/packages-and-plugins/developing-packages#federated-plugins) to better support multiple environments and implementations. + ## 6.0.0-beta.28 - Added `ProcessGlobalConfig` for Android WebViews diff --git a/example/integration_test/cookie_manager/set_get_delete.dart b/example/integration_test/cookie_manager/set_get_delete.dart index be507f41..8a9f499b 100644 --- a/example/integration_test/cookie_manager/set_get_delete.dart +++ b/example/integration_test/cookie_manager/set_get_delete.dart @@ -11,8 +11,8 @@ void setGetDelete() { skippableTestWidgets('set, get, delete', (WidgetTester tester) async { CookieManager cookieManager = CookieManager.instance(); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); var headlessWebView = new HeadlessInAppWebView( @@ -20,12 +20,12 @@ void setGetDelete() { onWebViewCreated: (controller) { controllerCompleter.complete(controller); }, + onLoadStop: (controller, url) async { + pageLoaded.complete(url!.toString()); + } ); if (defaultTargetPlatform == TargetPlatform.macOS) { - headlessWebView.onLoadStop = (controller, url) async { - pageLoaded.complete(url!.toString()); - }; await headlessWebView.run(); } else { await tester.pumpWidget( diff --git a/example/integration_test/headless_in_app_webview/convert_to_inappwebview.dart b/example/integration_test/headless_in_app_webview/convert_to_inappwebview.dart index e553e7c4..2dee496c 100644 --- a/example/integration_test/headless_in_app_webview/convert_to_inappwebview.dart +++ b/example/integration_test/headless_in_app_webview/convert_to_inappwebview.dart @@ -9,8 +9,8 @@ void convertToInAppWebView() { ].contains(defaultTargetPlatform); skippableTestWidgets('convert to InAppWebView', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); var headlessWebView = new HeadlessInAppWebView( @@ -18,22 +18,22 @@ void convertToInAppWebView() { onWebViewCreated: (controller) { controllerCompleter.complete(controller); }, + onLoadStop: (controller, url) async { + pageLoaded.complete(); + } ); - headlessWebView.onLoadStop = (controller, url) async { - pageLoaded.complete(); - }; await headlessWebView.run(); expect(headlessWebView.isRunning(), true); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; final String? url = (await controller.getUrl())?.toString(); expect(url, TEST_CROSS_PLATFORM_URL_1.toString()); - final Completer widgetControllerCompleter = - Completer(); + final Completer widgetControllerCompleter = + Completer(); final Completer loadedUrl = Completer(); await tester.pumpWidget( @@ -54,7 +54,7 @@ void convertToInAppWebView() { ), ), ); - final InAppWebViewController widgetController = + final PlatformInAppWebViewController widgetController = await widgetControllerCompleter.future; expect(headlessWebView.isRunning(), false); diff --git a/example/integration_test/headless_in_app_webview/custom_size.dart b/example/integration_test/headless_in_app_webview/custom_size.dart index 2147408d..34b997dc 100644 --- a/example/integration_test/headless_in_app_webview/custom_size.dart +++ b/example/integration_test/headless_in_app_webview/custom_size.dart @@ -10,8 +10,8 @@ void customSize() { ].contains(defaultTargetPlatform); skippableTest('set and get custom size', () async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); var headlessWebView = new HeadlessInAppWebView( initialUrlRequest: URLRequest(url: TEST_CROSS_PLATFORM_URL_1), diff --git a/example/integration_test/headless_in_app_webview/run_and_dispose.dart b/example/integration_test/headless_in_app_webview/run_and_dispose.dart index b491aef3..21576b9c 100644 --- a/example/integration_test/headless_in_app_webview/run_and_dispose.dart +++ b/example/integration_test/headless_in_app_webview/run_and_dispose.dart @@ -10,8 +10,8 @@ void runAndDispose() { ].contains(defaultTargetPlatform); skippableTest('run and dispose', () async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); var headlessWebView = new HeadlessInAppWebView( @@ -19,15 +19,15 @@ void runAndDispose() { onWebViewCreated: (controller) { controllerCompleter.complete(controller); }, + onLoadStop: (controller, url) async { + pageLoaded.complete(); + } ); - headlessWebView.onLoadStop = (controller, url) async { - pageLoaded.complete(); - }; await headlessWebView.run(); expect(headlessWebView.isRunning(), true); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; final String? url = (await controller.getUrl())?.toString(); diff --git a/example/integration_test/headless_in_app_webview/set_get_settings.dart b/example/integration_test/headless_in_app_webview/set_get_settings.dart index 07489aff..a1cf6adf 100644 --- a/example/integration_test/headless_in_app_webview/set_get_settings.dart +++ b/example/integration_test/headless_in_app_webview/set_get_settings.dart @@ -10,8 +10,8 @@ void setGetSettings() { ].contains(defaultTargetPlatform); skippableTest('set/get settings', () async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); var headlessWebView = new HeadlessInAppWebView( @@ -26,7 +26,7 @@ void setGetSettings() { ); await headlessWebView.run(); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; var settings = await controller.getSettings(); diff --git a/example/integration_test/headless_in_app_webview/take_screenshot.dart b/example/integration_test/headless_in_app_webview/take_screenshot.dart index 5009e47f..aee83224 100644 --- a/example/integration_test/headless_in_app_webview/take_screenshot.dart +++ b/example/integration_test/headless_in_app_webview/take_screenshot.dart @@ -9,8 +9,8 @@ void takeScreenshot() { ].contains(defaultTargetPlatform); skippableTest('take screenshot', () async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); var headlessWebView = new HeadlessInAppWebView( @@ -27,7 +27,7 @@ void takeScreenshot() { await headlessWebView.run(); expect(headlessWebView.isRunning(), true); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; final String? url = (await controller.getUrl())?.toString(); diff --git a/example/integration_test/in_app_localhost_server/load_asset_file.dart b/example/integration_test/in_app_localhost_server/load_asset_file.dart index 8b84625f..e80d82e4 100644 --- a/example/integration_test/in_app_localhost_server/load_asset_file.dart +++ b/example/integration_test/in_app_localhost_server/load_asset_file.dart @@ -12,8 +12,8 @@ void loadAssetFile(InAppLocalhostServer localhostServer) { skippableTestWidgets('load asset file', (WidgetTester tester) async { expect(localhostServer.isRunning(), true); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); var headlessWebView = new HeadlessInAppWebView( initialUrlRequest: URLRequest( @@ -40,7 +40,7 @@ void loadAssetFile(InAppLocalhostServer localhostServer) { ), ); } - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; final String? currentUrl = (await controller.getUrl())?.toString(); expect(currentUrl, 'http://localhost:8080/test_assets/index.html'); diff --git a/example/integration_test/in_app_webview/audio_playback_policy.dart b/example/integration_test/in_app_webview/audio_playback_policy.dart index 0176047d..ab90cb60 100644 --- a/example/integration_test/in_app_webview/audio_playback_policy.dart +++ b/example/integration_test/in_app_webview/audio_playback_policy.dart @@ -41,8 +41,8 @@ void audioPlaybackPolicy() { }); skippableTestWidgets('Auto media playback', (WidgetTester tester) async { - Completer controllerCompleter = - Completer(); + Completer controllerCompleter = + Completer(); Completer pageStarted = Completer(); Completer pageLoaded = Completer(); @@ -69,7 +69,7 @@ void audioPlaybackPolicy() { ), ), ); - InAppWebViewController controller = await controllerCompleter.future; + PlatformInAppWebViewController controller = await controllerCompleter.future; await pageStarted.future; await pageLoaded.future; @@ -77,7 +77,7 @@ void audioPlaybackPolicy() { await controller.evaluateJavascript(source: 'isPaused();'); expect(isPaused, false); - controllerCompleter = Completer(); + controllerCompleter = Completer(); pageStarted = Completer(); pageLoaded = Completer(); diff --git a/example/integration_test/in_app_webview/clear_cache.dart b/example/integration_test/in_app_webview/clear_cache.dart index 8c4ece5b..fc608c77 100644 --- a/example/integration_test/in_app_webview/clear_cache.dart +++ b/example/integration_test/in_app_webview/clear_cache.dart @@ -10,8 +10,8 @@ void clearCache() { ].contains(defaultTargetPlatform); skippableTestWidgets('clearCache', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -30,7 +30,7 @@ void clearCache() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await expectLater(controller.clearCache(), completes); }, skip: shouldSkip); diff --git a/example/integration_test/in_app_webview/clear_focus.dart b/example/integration_test/in_app_webview/clear_focus.dart index e961bcf3..9bc18861 100644 --- a/example/integration_test/in_app_webview/clear_focus.dart +++ b/example/integration_test/in_app_webview/clear_focus.dart @@ -10,8 +10,8 @@ void clearFocus() { ].contains(defaultTargetPlatform); skippableTestWidgets('clearFocus', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -30,7 +30,7 @@ void clearFocus() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await expectLater(controller.clearFocus(), completes); diff --git a/example/integration_test/in_app_webview/clear_ssl_preferences.dart b/example/integration_test/in_app_webview/clear_ssl_preferences.dart index c02c2714..fc06075b 100644 --- a/example/integration_test/in_app_webview/clear_ssl_preferences.dart +++ b/example/integration_test/in_app_webview/clear_ssl_preferences.dart @@ -8,8 +8,8 @@ void clearSslPreferences() { ].contains(defaultTargetPlatform); skippableTestWidgets('clearSslPreferences', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -28,7 +28,7 @@ void clearSslPreferences() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await expectLater(controller.clearSslPreferences(), completes); }, skip: shouldSkip); diff --git a/example/integration_test/in_app_webview/content_blocker.dart b/example/integration_test/in_app_webview/content_blocker.dart index 03ba8060..f6ed13db 100644 --- a/example/integration_test/in_app_webview/content_blocker.dart +++ b/example/integration_test/in_app_webview/content_blocker.dart @@ -10,8 +10,8 @@ void contentBlocker() { ].contains(defaultTargetPlatform); skippableTestWidgets('Content Blocker', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( Directionality( diff --git a/example/integration_test/in_app_webview/create_pdf.dart b/example/integration_test/in_app_webview/create_pdf.dart index acf78371..ce685ce6 100644 --- a/example/integration_test/in_app_webview/create_pdf.dart +++ b/example/integration_test/in_app_webview/create_pdf.dart @@ -9,8 +9,8 @@ void createPdf() { ].contains(defaultTargetPlatform); skippableTestWidgets('createPdf', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -29,7 +29,7 @@ void createPdf() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; var pdfConfiguration = PDFConfiguration( diff --git a/example/integration_test/in_app_webview/get_certificate.dart b/example/integration_test/in_app_webview/get_certificate.dart index fc43fef6..d96f1121 100644 --- a/example/integration_test/in_app_webview/get_certificate.dart +++ b/example/integration_test/in_app_webview/get_certificate.dart @@ -10,8 +10,8 @@ void getCertificate() { ].contains(defaultTargetPlatform); skippableTestWidgets('getCertificate', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -30,7 +30,7 @@ void getCertificate() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; var sslCertificate = await controller.getCertificate(); diff --git a/example/integration_test/in_app_webview/get_content_height.dart b/example/integration_test/in_app_webview/get_content_height.dart index 1e1635fc..7e773ee0 100644 --- a/example/integration_test/in_app_webview/get_content_height.dart +++ b/example/integration_test/in_app_webview/get_content_height.dart @@ -12,8 +12,8 @@ void getContentHeight() { var url = !kIsWeb ? TEST_CROSS_PLATFORM_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('getContentHeight', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -32,7 +32,7 @@ void getContentHeight() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await tester.pump(); diff --git a/example/integration_test/in_app_webview/get_favicons.dart b/example/integration_test/in_app_webview/get_favicons.dart index d2ff44a2..20f05881 100644 --- a/example/integration_test/in_app_webview/get_favicons.dart +++ b/example/integration_test/in_app_webview/get_favicons.dart @@ -12,8 +12,8 @@ void getFavicons() { var url = !kIsWeb ? TEST_CROSS_PLATFORM_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('getFavicons', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -32,7 +32,7 @@ void getFavicons() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; final List? favicons = await controller.getFavicons(); diff --git a/example/integration_test/in_app_webview/get_html.dart b/example/integration_test/in_app_webview/get_html.dart index a6230478..6d764ecf 100644 --- a/example/integration_test/in_app_webview/get_html.dart +++ b/example/integration_test/in_app_webview/get_html.dart @@ -12,8 +12,8 @@ void getHtml() { var url = !kIsWeb ? TEST_CROSS_PLATFORM_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('getHtml', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -32,7 +32,7 @@ void getHtml() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; final String? html = await controller.getHtml(); diff --git a/example/integration_test/in_app_webview/get_meta_tags.dart b/example/integration_test/in_app_webview/get_meta_tags.dart index e30b703e..984cbccb 100644 --- a/example/integration_test/in_app_webview/get_meta_tags.dart +++ b/example/integration_test/in_app_webview/get_meta_tags.dart @@ -12,8 +12,8 @@ void getMetaTags() { var url = !kIsWeb ? TEST_CROSS_PLATFORM_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('getMetaTags', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -32,7 +32,7 @@ void getMetaTags() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; List metaTags = await controller.getMetaTags(); diff --git a/example/integration_test/in_app_webview/get_meta_theme_color.dart b/example/integration_test/in_app_webview/get_meta_theme_color.dart index 15f8fe86..70a7648d 100644 --- a/example/integration_test/in_app_webview/get_meta_theme_color.dart +++ b/example/integration_test/in_app_webview/get_meta_theme_color.dart @@ -12,8 +12,8 @@ void getMetaThemeColor() { var url = !kIsWeb ? TEST_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('getMetaThemeColor', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -32,7 +32,7 @@ void getMetaThemeColor() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; expect(await controller.getMetaThemeColor(), isNotNull); diff --git a/example/integration_test/in_app_webview/get_original_url.dart b/example/integration_test/in_app_webview/get_original_url.dart index 635e95d9..f98aba25 100644 --- a/example/integration_test/in_app_webview/get_original_url.dart +++ b/example/integration_test/in_app_webview/get_original_url.dart @@ -12,8 +12,8 @@ void getOriginalUrl() { var url = !kIsWeb ? TEST_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('getOriginalUrl', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -32,7 +32,7 @@ void getOriginalUrl() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; var originUrl = (await controller.getOriginalUrl())?.toString(); expect(originUrl, url.toString()); diff --git a/example/integration_test/in_app_webview/get_progress.dart b/example/integration_test/in_app_webview/get_progress.dart index e550307c..28192ad9 100644 --- a/example/integration_test/in_app_webview/get_progress.dart +++ b/example/integration_test/in_app_webview/get_progress.dart @@ -10,8 +10,8 @@ void getProgress() { ].contains(defaultTargetPlatform); skippableTestWidgets('getProgress', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -30,7 +30,7 @@ void getProgress() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; final int? progress = await controller.getProgress(); diff --git a/example/integration_test/in_app_webview/get_title.dart b/example/integration_test/in_app_webview/get_title.dart index dcd49224..37e718bd 100644 --- a/example/integration_test/in_app_webview/get_title.dart +++ b/example/integration_test/in_app_webview/get_title.dart @@ -28,8 +28,8 @@ void getTitle() { skippableTestWidgets('getTitle', (WidgetTester tester) async { final Completer pageStarted = Completer(); final Completer pageLoaded = Completer(); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); await tester.pumpWidget( Directionality( @@ -49,7 +49,7 @@ void getTitle() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageStarted.future; await pageLoaded.future; diff --git a/example/integration_test/in_app_webview/http_auth_credential_database.dart b/example/integration_test/in_app_webview/http_auth_credential_database.dart index fc1ebef5..fb0bda56 100644 --- a/example/integration_test/in_app_webview/http_auth_credential_database.dart +++ b/example/integration_test/in_app_webview/http_auth_credential_database.dart @@ -13,8 +13,8 @@ void httpAuthCredentialDatabase() { skippableTestWidgets('use saved credentials', (WidgetTester tester) async { HttpAuthCredentialDatabase httpAuthCredentialDatabase = HttpAuthCredentialDatabase.instance(); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); httpAuthCredentialDatabase.setHttpAuthCredential( @@ -50,7 +50,7 @@ void httpAuthCredentialDatabase() { ), ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -77,8 +77,8 @@ void httpAuthCredentialDatabase() { }); skippableTestWidgets('save credentials', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -107,7 +107,7 @@ void httpAuthCredentialDatabase() { ), ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; diff --git a/example/integration_test/in_app_webview/initial_url_request.dart b/example/integration_test/in_app_webview/initial_url_request.dart index 792467b3..1629eb0c 100644 --- a/example/integration_test/in_app_webview/initial_url_request.dart +++ b/example/integration_test/in_app_webview/initial_url_request.dart @@ -21,8 +21,8 @@ void initialUrlRequest() { 'launches with allowsBackForwardNavigationGestures true', (WidgetTester tester) async { final Completer pageLoaded = Completer(); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); await tester.pumpWidget( Directionality( @@ -46,7 +46,7 @@ void initialUrlRequest() { ), ); await pageLoaded.future; - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; final String? currentUrl = (await controller.getUrl())?.toString(); expect(currentUrl, TEST_URL_1.toString()); @@ -62,8 +62,8 @@ void initialUrlRequest() { skippableTestWidgets('basic', (WidgetTester tester) async { final Completer pageLoaded = Completer(); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); await tester.pumpWidget( Directionality( @@ -82,7 +82,7 @@ void initialUrlRequest() { ); await pageLoaded.future; - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; final String? currentUrl = (await controller.getUrl())?.toString(); diff --git a/example/integration_test/in_app_webview/inject_css.dart b/example/integration_test/in_app_webview/inject_css.dart index cb556394..238ad8b9 100644 --- a/example/integration_test/in_app_webview/inject_css.dart +++ b/example/integration_test/in_app_webview/inject_css.dart @@ -13,8 +13,8 @@ void injectCSS() { skippableGroup('inject CSS', () { skippableTestWidgets('code', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -33,7 +33,7 @@ void injectCSS() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -52,8 +52,8 @@ void injectCSS() { }); skippableTestWidgets('file from url', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -72,7 +72,7 @@ void injectCSS() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -88,8 +88,8 @@ void injectCSS() { }); skippableTestWidgets('file from asset', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -108,7 +108,7 @@ void injectCSS() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; diff --git a/example/integration_test/in_app_webview/inject_javascript_file.dart b/example/integration_test/in_app_webview/inject_javascript_file.dart index 1f60b5c0..01d4b2a1 100644 --- a/example/integration_test/in_app_webview/inject_javascript_file.dart +++ b/example/integration_test/in_app_webview/inject_javascript_file.dart @@ -13,8 +13,8 @@ void injectJavascriptFile() { skippableGroup('inject javascript file', () { skippableTestWidgets('from url', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer jQueryLoaded = Completer(); final Completer jQueryLoadError = Completer(); @@ -35,7 +35,7 @@ void injectJavascriptFile() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -75,8 +75,8 @@ void injectJavascriptFile() { }); skippableTestWidgets('from asset', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -95,7 +95,7 @@ void injectJavascriptFile() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; diff --git a/example/integration_test/in_app_webview/intercept_ajax_request.dart b/example/integration_test/in_app_webview/intercept_ajax_request.dart index dfcec00b..8d45bc5f 100644 --- a/example/integration_test/in_app_webview/intercept_ajax_request.dart +++ b/example/integration_test/in_app_webview/intercept_ajax_request.dart @@ -11,8 +11,8 @@ void interceptAjaxRequest() { skippableGroup('intercept ajax request', () { skippableTestWidgets('send string data', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer shouldInterceptAjaxPostRequestCompleter = Completer(); final Completer> onAjaxReadyStateChangeCompleter = @@ -93,8 +93,8 @@ void interceptAjaxRequest() { }); skippableTestWidgets('send json data', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer shouldInterceptAjaxPostRequestCompleter = Completer(); final Completer> onAjaxReadyStateChangeCompleter = @@ -182,8 +182,8 @@ void interceptAjaxRequest() { skippableTestWidgets('send URLSearchParams data', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer shouldInterceptAjaxPostRequestCompleter = Completer(); final Completer> onAjaxReadyStateChangeCompleter = @@ -266,8 +266,8 @@ void interceptAjaxRequest() { }); skippableTestWidgets('send FormData', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer shouldInterceptAjaxPostRequestCompleter = Completer(); final Completer> onAjaxReadyStateChangeCompleter = diff --git a/example/integration_test/in_app_webview/intercept_fetch_request.dart b/example/integration_test/in_app_webview/intercept_fetch_request.dart index 982dee13..0b42d64d 100644 --- a/example/integration_test/in_app_webview/intercept_fetch_request.dart +++ b/example/integration_test/in_app_webview/intercept_fetch_request.dart @@ -11,8 +11,8 @@ void interceptFetchRequest() { skippableGroup('intercept fetch request', () { skippableTestWidgets('send string data', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer> fetchPostCompleter = Completer>(); final Completer shouldInterceptFetchPostRequestCompleter = @@ -86,8 +86,8 @@ void interceptFetchRequest() { }); skippableTestWidgets('send json data', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer> fetchPostCompleter = Completer>(); final Completer shouldInterceptFetchPostRequestCompleter = @@ -168,8 +168,8 @@ void interceptFetchRequest() { skippableTestWidgets('send URLSearchParams data', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer> fetchPostCompleter = Completer>(); final Completer shouldInterceptFetchPostRequestCompleter = @@ -245,8 +245,8 @@ void interceptFetchRequest() { }); skippableTestWidgets('send FormData', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer> fetchPostCompleter = Completer>(); final Completer shouldInterceptFetchPostRequestCompleter = diff --git a/example/integration_test/in_app_webview/is_loading.dart b/example/integration_test/in_app_webview/is_loading.dart index 3323e7fc..7b76704e 100644 --- a/example/integration_test/in_app_webview/is_loading.dart +++ b/example/integration_test/in_app_webview/is_loading.dart @@ -10,8 +10,8 @@ void isLoading() { ].contains(defaultTargetPlatform); skippableTestWidgets('isLoading', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageStarted = Completer(); final Completer pageLoaded = Completer(); @@ -35,7 +35,7 @@ void isLoading() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageStarted.future; expect(await controller.isLoading(), true); diff --git a/example/integration_test/in_app_webview/is_secure_context.dart b/example/integration_test/in_app_webview/is_secure_context.dart index 3c5d8a6c..81c0e4b6 100644 --- a/example/integration_test/in_app_webview/is_secure_context.dart +++ b/example/integration_test/in_app_webview/is_secure_context.dart @@ -12,8 +12,8 @@ void isSecureContext() { var url = !kIsWeb ? TEST_CROSS_PLATFORM_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('isSecureContext', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); @@ -33,7 +33,7 @@ void isSecureContext() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoads.stream.first; expect(await controller.isSecureContext(), true); diff --git a/example/integration_test/in_app_webview/javascript_code_evaluation.dart b/example/integration_test/in_app_webview/javascript_code_evaluation.dart index 8f9a683f..bdff96ea 100644 --- a/example/integration_test/in_app_webview/javascript_code_evaluation.dart +++ b/example/integration_test/in_app_webview/javascript_code_evaluation.dart @@ -19,8 +19,8 @@ void javascriptCodeEvaluation() { ].contains(defaultTargetPlatform); skippableTestWidgets('evaluateJavascript', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -38,7 +38,7 @@ void javascriptCodeEvaluation() { ), ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -63,8 +63,8 @@ void javascriptCodeEvaluation() { skippableTestWidgets('evaluateJavascript with content world', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -82,7 +82,7 @@ void javascriptCodeEvaluation() { ), ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -107,8 +107,8 @@ void javascriptCodeEvaluation() { ].contains(defaultTargetPlatform); skippableTestWidgets('callAsyncJavaScript', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -126,7 +126,7 @@ void javascriptCodeEvaluation() { ), ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -169,8 +169,8 @@ void javascriptCodeEvaluation() { skippableTestWidgets('callAsyncJavaScript with content world', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -188,7 +188,7 @@ void javascriptCodeEvaluation() { ), ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; diff --git a/example/integration_test/in_app_webview/javascript_dialogs.dart b/example/integration_test/in_app_webview/javascript_dialogs.dart index 6b465425..3f0c804a 100644 --- a/example/integration_test/in_app_webview/javascript_dialogs.dart +++ b/example/integration_test/in_app_webview/javascript_dialogs.dart @@ -10,8 +10,8 @@ void javascriptDialogs() { ].contains(defaultTargetPlatform); skippableTestWidgets('javascript dialogs', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer alertCompleter = Completer(); diff --git a/example/integration_test/in_app_webview/javascript_handler.dart b/example/integration_test/in_app_webview/javascript_handler.dart index 5658ca62..fee6064f 100644 --- a/example/integration_test/in_app_webview/javascript_handler.dart +++ b/example/integration_test/in_app_webview/javascript_handler.dart @@ -10,8 +10,8 @@ void javascriptHandler() { ].contains(defaultTargetPlatform); skippableTestWidgets('JavaScript Handler', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageStarted = Completer(); final Completer pageLoaded = Completer(); final Completer handlerFoo = Completer(); diff --git a/example/integration_test/in_app_webview/keep_alive.dart b/example/integration_test/in_app_webview/keep_alive.dart index dac09ac3..93e9ead4 100644 --- a/example/integration_test/in_app_webview/keep_alive.dart +++ b/example/integration_test/in_app_webview/keep_alive.dart @@ -15,10 +15,10 @@ void keepAlive() { skippableTestWidgets('Keep Alive', (WidgetTester tester) async { final keepAlive = InAppWebViewKeepAlive(); - final Completer controllerCompleter = - Completer(); - final Completer controllerCompleter2 = - Completer(); + final Completer controllerCompleter = + Completer(); + final Completer controllerCompleter2 = + Completer(); final Completer pageLoaded = Completer(); final Completer pageLoaded2 = Completer(); @@ -46,7 +46,7 @@ void keepAlive() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await controller.loadUrl( @@ -64,7 +64,7 @@ void keepAlive() { }, )), ); - final InAppWebViewController controller2 = + final PlatformInAppWebViewController controller2 = await controllerCompleter2.future; final String? currentUrl = (await controller2.getUrl())?.toString(); diff --git a/example/integration_test/in_app_webview/load_data.dart b/example/integration_test/in_app_webview/load_data.dart index e5fb32ee..7501b858 100644 --- a/example/integration_test/in_app_webview/load_data.dart +++ b/example/integration_test/in_app_webview/load_data.dart @@ -10,8 +10,8 @@ void loadData() { ].contains(defaultTargetPlatform); skippableTestWidgets('loadData', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); @@ -31,7 +31,7 @@ void loadData() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoads.stream.first; final data = """ diff --git a/example/integration_test/in_app_webview/load_file.dart b/example/integration_test/in_app_webview/load_file.dart index 09dbbcc8..225489a4 100644 --- a/example/integration_test/in_app_webview/load_file.dart +++ b/example/integration_test/in_app_webview/load_file.dart @@ -10,8 +10,8 @@ void loadFile() { ].contains(defaultTargetPlatform); skippableTestWidgets('loadFile', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); @@ -31,7 +31,7 @@ void loadFile() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoads.stream.first; await controller.loadFile( diff --git a/example/integration_test/in_app_webview/load_url.dart b/example/integration_test/in_app_webview/load_url.dart index bdb1f5be..dfa7657c 100644 --- a/example/integration_test/in_app_webview/load_url.dart +++ b/example/integration_test/in_app_webview/load_url.dart @@ -12,8 +12,8 @@ void loadUrl() { var initialUrl = !kIsWeb ? TEST_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('loadUrl', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer firstUrlLoad = Completer(); final Completer loadedUrl = Completer(); @@ -38,7 +38,7 @@ void loadUrl() { ), ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; expect(await firstUrlLoad.future, initialUrl.toString()); await controller.loadUrl( @@ -54,8 +54,8 @@ void loadUrl() { ].contains(defaultTargetPlatform); skippableTestWidgets('loadSimulatedRequest', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer firstUrlLoad = Completer(); final Completer loadedUrl = Completer(); @@ -80,7 +80,7 @@ void loadUrl() { ), ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; expect(await firstUrlLoad.future, initialUrl.toString()); final htmlCode = "

Hello

"; diff --git a/example/integration_test/in_app_webview/on_console_message.dart b/example/integration_test/in_app_webview/on_console_message.dart index 495d12c4..72c682d1 100644 --- a/example/integration_test/in_app_webview/on_console_message.dart +++ b/example/integration_test/in_app_webview/on_console_message.dart @@ -10,8 +10,8 @@ void onConsoleMessage() { ].contains(defaultTargetPlatform); skippableTestWidgets('onConsoleMessage', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer onConsoleMessageCompleter = Completer(); await tester.pumpWidget( diff --git a/example/integration_test/in_app_webview/on_download_start_request.dart b/example/integration_test/in_app_webview/on_download_start_request.dart index ba735534..6c7099e2 100644 --- a/example/integration_test/in_app_webview/on_download_start_request.dart +++ b/example/integration_test/in_app_webview/on_download_start_request.dart @@ -10,8 +10,8 @@ void onDownloadStartRequest() { ].contains(defaultTargetPlatform); skippableTestWidgets('onDownloadStartRequest', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer onDownloadStartCompleter = Completer(); await tester.pumpWidget( Directionality( diff --git a/example/integration_test/in_app_webview/on_js_before_unload.dart b/example/integration_test/in_app_webview/on_js_before_unload.dart index 19471c59..887d26b2 100644 --- a/example/integration_test/in_app_webview/on_js_before_unload.dart +++ b/example/integration_test/in_app_webview/on_js_before_unload.dart @@ -9,8 +9,8 @@ void onJsBeforeUnload() { final shouldSkip = true; // on Android, for some reason, it works on an example app but not in this test skippableTestWidgets('onJsBeforeUnload', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer onJsBeforeUnloadCompleter = Completer(); await tester.pumpWidget( diff --git a/example/integration_test/in_app_webview/on_load_resource_with_custom_scheme.dart b/example/integration_test/in_app_webview/on_load_resource_with_custom_scheme.dart index 4b0964f1..31e82c8a 100644 --- a/example/integration_test/in_app_webview/on_load_resource_with_custom_scheme.dart +++ b/example/integration_test/in_app_webview/on_load_resource_with_custom_scheme.dart @@ -11,8 +11,8 @@ void onLoadResourceWithCustomScheme() { skippableTestWidgets('onLoadResourceWithCustomScheme', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer imageLoaded = Completer(); await tester.pumpWidget( diff --git a/example/integration_test/in_app_webview/on_navigation_response.dart b/example/integration_test/in_app_webview/on_navigation_response.dart index 70aea1d9..83ad74b0 100644 --- a/example/integration_test/in_app_webview/on_navigation_response.dart +++ b/example/integration_test/in_app_webview/on_navigation_response.dart @@ -10,8 +10,8 @@ void onNavigationResponse() { skippableGroup('onNavigationResponse', () { skippableTestWidgets('allow navigation', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer onNavigationResponseCompleter = Completer(); @@ -43,8 +43,8 @@ void onNavigationResponse() { }); skippableTestWidgets('cancel navigation', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer onNavigationResponseCompleter = Completer(); diff --git a/example/integration_test/in_app_webview/on_page_commit_visible.dart b/example/integration_test/in_app_webview/on_page_commit_visible.dart index ecfd036d..cd4c3ebb 100644 --- a/example/integration_test/in_app_webview/on_page_commit_visible.dart +++ b/example/integration_test/in_app_webview/on_page_commit_visible.dart @@ -10,8 +10,8 @@ void onPageCommitVisible() { ].contains(defaultTargetPlatform); skippableTestWidgets('onPageCommitVisible', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer onPageCommitVisibleCompleter = Completer(); await tester.pumpWidget( diff --git a/example/integration_test/in_app_webview/on_permission_request.dart b/example/integration_test/in_app_webview/on_permission_request.dart index 115adb27..99c7fbd2 100644 --- a/example/integration_test/in_app_webview/on_permission_request.dart +++ b/example/integration_test/in_app_webview/on_permission_request.dart @@ -12,8 +12,8 @@ void onPermissionRequest() { final expectedValue = [PermissionResourceType.CAMERA]; skippableTestWidgets('onPermissionRequest', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer> onPermissionRequestCompleter = Completer>(); @@ -40,7 +40,7 @@ void onPermissionRequest() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await controller.evaluateJavascript( source: "document.querySelector('#camera').click();"); @@ -61,8 +61,8 @@ void onPermissionRequest() { skippableTestWidgets('onPermissionRequestCanceled', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer> onPermissionRequestCompleter = Completer>(); @@ -99,7 +99,7 @@ void onPermissionRequest() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await controller.evaluateJavascript( source: "document.querySelector('#camera').click();"); diff --git a/example/integration_test/in_app_webview/on_received_icon.dart b/example/integration_test/in_app_webview/on_received_icon.dart index 22d6c5c1..a8d7aedb 100644 --- a/example/integration_test/in_app_webview/on_received_icon.dart +++ b/example/integration_test/in_app_webview/on_received_icon.dart @@ -8,8 +8,8 @@ void onReceivedIcon() { ].contains(defaultTargetPlatform); skippableTestWidgets('onReceivedIcon', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer onReceivedIconCompleter = Completer(); diff --git a/example/integration_test/in_app_webview/on_received_touch_icon_url.dart b/example/integration_test/in_app_webview/on_received_touch_icon_url.dart index 3f3e9ad9..63a6dc9a 100644 --- a/example/integration_test/in_app_webview/on_received_touch_icon_url.dart +++ b/example/integration_test/in_app_webview/on_received_touch_icon_url.dart @@ -8,8 +8,8 @@ void onReceivedTouchIconUrl() { ].contains(defaultTargetPlatform); skippableTestWidgets('onReceivedTouchIconUrl', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer onReceivedTouchIconUrlCompleter = Completer(); diff --git a/example/integration_test/in_app_webview/on_scroll_changed.dart b/example/integration_test/in_app_webview/on_scroll_changed.dart index 6903cbc8..b2d0da80 100644 --- a/example/integration_test/in_app_webview/on_scroll_changed.dart +++ b/example/integration_test/in_app_webview/on_scroll_changed.dart @@ -12,8 +12,8 @@ void onScrollChanged() { var url = !kIsWeb ? TEST_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('onScrollChanged', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer onScrollChangedCompleter = Completer(); await tester.pumpWidget( @@ -37,7 +37,7 @@ void onScrollChanged() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await tester.pump(); diff --git a/example/integration_test/in_app_webview/on_title_changed.dart b/example/integration_test/in_app_webview/on_title_changed.dart index d0f6fb5a..25b3c740 100644 --- a/example/integration_test/in_app_webview/on_title_changed.dart +++ b/example/integration_test/in_app_webview/on_title_changed.dart @@ -12,8 +12,8 @@ void onTitleChanged() { var url = !kIsWeb ? TEST_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('onTitleChanged', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer onTitleChangedCompleter = Completer(); @@ -40,7 +40,7 @@ void onTitleChanged() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await tester.pump(); await controller.evaluateJavascript( diff --git a/example/integration_test/in_app_webview/on_update_visited_history.dart b/example/integration_test/in_app_webview/on_update_visited_history.dart index 9976e81e..c6655b57 100644 --- a/example/integration_test/in_app_webview/on_update_visited_history.dart +++ b/example/integration_test/in_app_webview/on_update_visited_history.dart @@ -12,8 +12,8 @@ void onUpdateVisitedHistory() { var url = !kIsWeb ? TEST_CROSS_PLATFORM_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('onUpdateVisitedHistory', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer firstPushCompleter = Completer(); final Completer secondPushCompleter = Completer(); final Completer pageLoaded = Completer(); @@ -42,7 +42,7 @@ void onUpdateVisitedHistory() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await controller.evaluateJavascript(source: """ diff --git a/example/integration_test/in_app_webview/page_down_up.dart b/example/integration_test/in_app_webview/page_down_up.dart index ccc8e1d1..ee12d261 100644 --- a/example/integration_test/in_app_webview/page_down_up.dart +++ b/example/integration_test/in_app_webview/page_down_up.dart @@ -8,8 +8,8 @@ void pageDownUp() { ].contains(defaultTargetPlatform); skippableTestWidgets('pageDown/pageUp', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -28,7 +28,7 @@ void pageDownUp() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await tester.pump(); await Future.delayed(Duration(seconds: 1)); diff --git a/example/integration_test/in_app_webview/pause_resume.dart b/example/integration_test/in_app_webview/pause_resume.dart index 9c4c80f2..3d68afe8 100644 --- a/example/integration_test/in_app_webview/pause_resume.dart +++ b/example/integration_test/in_app_webview/pause_resume.dart @@ -8,8 +8,8 @@ void pauseResume() { ].contains(defaultTargetPlatform); skippableTestWidgets('pause/resume', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -28,7 +28,7 @@ void pauseResume() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await expectLater(controller.pause(), completes); await Future.delayed(Duration(seconds: 1)); diff --git a/example/integration_test/in_app_webview/pause_resume_timers.dart b/example/integration_test/in_app_webview/pause_resume_timers.dart index e00fa6f9..7255681b 100644 --- a/example/integration_test/in_app_webview/pause_resume_timers.dart +++ b/example/integration_test/in_app_webview/pause_resume_timers.dart @@ -10,8 +10,8 @@ void pauseResumeTimers() { ].contains(defaultTargetPlatform); skippableTestWidgets('pause/resume timers', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -30,7 +30,7 @@ void pauseResumeTimers() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await controller.evaluateJavascript(source: """ diff --git a/example/integration_test/in_app_webview/post_requests.dart b/example/integration_test/in_app_webview/post_requests.dart index d771e533..feae01eb 100644 --- a/example/integration_test/in_app_webview/post_requests.dart +++ b/example/integration_test/in_app_webview/post_requests.dart @@ -11,8 +11,8 @@ void postRequests() { skippableGroup('POST requests', () { skippableTestWidgets('initialUrlRequest', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer postPageLoaded = Completer(); await tester.pumpWidget( @@ -36,7 +36,7 @@ void postRequests() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await postPageLoaded.future; @@ -50,8 +50,8 @@ void postRequests() { }); skippableTestWidgets('loadUrl', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer postPageLoaded = Completer(); await tester.pumpWidget( @@ -72,7 +72,7 @@ void postRequests() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; var postData = Uint8List.fromList(utf8.encode("name=FooBar")); @@ -96,8 +96,8 @@ void postRequests() { }); skippableTestWidgets('postUrl', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer postPageLoaded = Completer(); await tester.pumpWidget( @@ -118,7 +118,7 @@ void postRequests() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; var postData = Uint8List.fromList(utf8.encode("name=FooBar")); diff --git a/example/integration_test/in_app_webview/print_current_page.dart b/example/integration_test/in_app_webview/print_current_page.dart index 13a11c0f..1ff639d4 100644 --- a/example/integration_test/in_app_webview/print_current_page.dart +++ b/example/integration_test/in_app_webview/print_current_page.dart @@ -12,8 +12,8 @@ void printCurrentPage() { var url = !kIsWeb ? TEST_CROSS_PLATFORM_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('printCurrentPage', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -32,7 +32,7 @@ void printCurrentPage() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await tester.pump(); await expectLater(controller.printCurrentPage(), completes); diff --git a/example/integration_test/in_app_webview/programmatic_scroll.dart b/example/integration_test/in_app_webview/programmatic_scroll.dart index 640e7129..aaf451b2 100644 --- a/example/integration_test/in_app_webview/programmatic_scroll.dart +++ b/example/integration_test/in_app_webview/programmatic_scroll.dart @@ -49,8 +49,8 @@ void programmaticScroll() { : TEST_WEB_PLATFORM_URL_1; final Completer pageLoaded = Completer(); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); await tester.pumpWidget( Directionality( @@ -67,7 +67,7 @@ void programmaticScroll() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -127,8 +127,8 @@ void programmaticScroll() { base64Encode(const Utf8Encoder().convert(scrollTestPage)); final Completer pageLoaded = Completer(); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); await tester.pumpWidget( Directionality( @@ -148,7 +148,7 @@ void programmaticScroll() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await controller.scrollTo(x: 0, y: 0); diff --git a/example/integration_test/in_app_webview/programmatic_zoom_scale.dart b/example/integration_test/in_app_webview/programmatic_zoom_scale.dart index 5694f5c0..e589ecd2 100644 --- a/example/integration_test/in_app_webview/programmatic_zoom_scale.dart +++ b/example/integration_test/in_app_webview/programmatic_zoom_scale.dart @@ -17,8 +17,8 @@ void programmaticZoomScale() { ].contains(defaultTargetPlatform); skippableTestWidgets('zoomIn/zoomOut', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -37,7 +37,7 @@ void programmaticZoomScale() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; expect(await controller.zoomIn(), true); @@ -46,8 +46,8 @@ void programmaticZoomScale() { }, skip: shouldSkipTest1); skippableTestWidgets('onZoomScaleChanged', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer onZoomScaleChangedCompleter = Completer(); @@ -76,7 +76,7 @@ void programmaticZoomScale() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; listenForScaleChange = true; @@ -87,8 +87,8 @@ void programmaticZoomScale() { }); skippableTestWidgets('zoomBy', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -107,7 +107,7 @@ void programmaticZoomScale() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -116,8 +116,8 @@ void programmaticZoomScale() { }); skippableTestWidgets('getZoomScale', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -136,7 +136,7 @@ void programmaticZoomScale() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; diff --git a/example/integration_test/in_app_webview/pull_to_refresh.dart b/example/integration_test/in_app_webview/pull_to_refresh.dart index 8ab88ae7..a69a1193 100644 --- a/example/integration_test/in_app_webview/pull_to_refresh.dart +++ b/example/integration_test/in_app_webview/pull_to_refresh.dart @@ -11,8 +11,8 @@ void pullToRefresh() { skippableTestWidgets('launches with pull-to-refresh feature', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final pullToRefreshController = PullToRefreshController( settings: PullToRefreshSettings( color: Colors.blue, @@ -38,7 +38,7 @@ void pullToRefresh() { ), ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; final String? currentUrl = (await controller.getUrl())?.toString(); expect(currentUrl, TEST_URL_1.toString()); }, skip: shouldSkip); diff --git a/example/integration_test/in_app_webview/reload.dart b/example/integration_test/in_app_webview/reload.dart index 5cdb218d..3ca577be 100644 --- a/example/integration_test/in_app_webview/reload.dart +++ b/example/integration_test/in_app_webview/reload.dart @@ -20,8 +20,8 @@ void reload() { ].contains(defaultTargetPlatform); skippableTestWidgets('from origin', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -42,15 +42,15 @@ void reload() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await expectLater(controller.reloadFromOrigin(), completes); }, skip: shouldSkipTest1); skippableTestWidgets('basic', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); @@ -69,7 +69,7 @@ void reload() { ), ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; String? reloadUrl = await pageLoads.stream.first; expect(reloadUrl, url.toString()); diff --git a/example/integration_test/in_app_webview/request_focus_node_href.dart b/example/integration_test/in_app_webview/request_focus_node_href.dart index 36c122fc..94b786c6 100644 --- a/example/integration_test/in_app_webview/request_focus_node_href.dart +++ b/example/integration_test/in_app_webview/request_focus_node_href.dart @@ -10,8 +10,8 @@ void requestFocusNodeHref() { ].contains(defaultTargetPlatform); skippableTestWidgets('requestFocusNodeHref', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -30,7 +30,7 @@ void requestFocusNodeHref() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await expectLater(controller.requestFocusNodeHref(), completes); diff --git a/example/integration_test/in_app_webview/request_image_ref.dart b/example/integration_test/in_app_webview/request_image_ref.dart index dbefee32..626308cc 100644 --- a/example/integration_test/in_app_webview/request_image_ref.dart +++ b/example/integration_test/in_app_webview/request_image_ref.dart @@ -10,8 +10,8 @@ void requestImageRef() { ].contains(defaultTargetPlatform); skippableTestWidgets('requestImageRef', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -30,7 +30,7 @@ void requestImageRef() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await expectLater(controller.requestImageRef(), completes); diff --git a/example/integration_test/in_app_webview/resize_webview.dart b/example/integration_test/in_app_webview/resize_webview.dart index 43540d09..8e052a74 100644 --- a/example/integration_test/in_app_webview/resize_webview.dart +++ b/example/integration_test/in_app_webview/resize_webview.dart @@ -31,8 +31,8 @@ void resizeWebView() { final Completer resizeCompleter = Completer(); final Completer pageStarted = Completer(); final Completer pageLoaded = Completer(); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final GlobalKey key = GlobalKey(); final InAppWebView webView = InAppWebView( diff --git a/example/integration_test/in_app_webview/set_custom_useragent.dart b/example/integration_test/in_app_webview/set_custom_useragent.dart index 56c7dc61..c4e558cc 100644 --- a/example/integration_test/in_app_webview/set_custom_useragent.dart +++ b/example/integration_test/in_app_webview/set_custom_useragent.dart @@ -10,7 +10,7 @@ void setCustomUserAgent() { ].contains(defaultTargetPlatform); skippableTestWidgets('set custom userAgent', (WidgetTester tester) async { - final Completer controllerCompleter1 = Completer(); + final Completer controllerCompleter1 = Completer(); await tester.pumpWidget( Directionality( textDirection: TextDirection.ltr, diff --git a/example/integration_test/in_app_webview/set_get_settings.dart b/example/integration_test/in_app_webview/set_get_settings.dart index 2c5a6d0f..28e2cd15 100644 --- a/example/integration_test/in_app_webview/set_get_settings.dart +++ b/example/integration_test/in_app_webview/set_get_settings.dart @@ -12,8 +12,8 @@ void setGetSettings() { final url = !kIsWeb ? TEST_CROSS_PLATFORM_URL_1 : TEST_WEB_PLATFORM_URL_1; skippableTestWidgets('set/get settings', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -32,7 +32,7 @@ void setGetSettings() { ), ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; InAppWebViewSettings? settings = await controller.getSettings(); diff --git a/example/integration_test/in_app_webview/should_intercept_request.dart b/example/integration_test/in_app_webview/should_intercept_request.dart index c3fd7baf..bfb44c54 100644 --- a/example/integration_test/in_app_webview/should_intercept_request.dart +++ b/example/integration_test/in_app_webview/should_intercept_request.dart @@ -15,8 +15,8 @@ void shouldInterceptRequest() { ]; List resourceLoaded = []; - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer loadedResourceCompleter = Completer(); diff --git a/example/integration_test/in_app_webview/should_override_url_loading.dart b/example/integration_test/in_app_webview/should_override_url_loading.dart index 507331e9..4a270410 100644 --- a/example/integration_test/in_app_webview/should_override_url_loading.dart +++ b/example/integration_test/in_app_webview/should_override_url_loading.dart @@ -16,8 +16,8 @@ void shouldOverrideUrlLoading() { base64Encode(const Utf8Encoder().convert(page)); skippableTestWidgets('can allow requests', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); await tester.pumpWidget( @@ -43,7 +43,7 @@ void shouldOverrideUrlLoading() { ); await pageLoads.stream.first; // Wait for initial page load. - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await controller.evaluateJavascript( source: 'location.href = "$TEST_URL_2"'); @@ -65,8 +65,8 @@ void shouldOverrideUrlLoading() { testWidgets( 'allow requests on iOS only if navigationType == NavigationType.LINK_ACTIVATED', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); await tester.pumpWidget( @@ -94,7 +94,7 @@ void shouldOverrideUrlLoading() { ); await pageLoads.stream.first; // Wait for initial page load. - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await controller.evaluateJavascript( source: 'location.href = "$TEST_URL_2"'); @@ -120,8 +120,8 @@ void shouldOverrideUrlLoading() { }, skip: shouldSkipTest2); skippableTestWidgets('can block requests', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); await tester.pumpWidget( @@ -147,7 +147,7 @@ void shouldOverrideUrlLoading() { ); await pageLoads.stream.first; // Wait for initial page load. - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await controller.evaluateJavascript( source: 'location.href = "$TEST_URL_4"'); @@ -169,8 +169,8 @@ void shouldOverrideUrlLoading() { skippableTestWidgets('supports asynchronous decisions', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); await tester.pumpWidget( @@ -197,7 +197,7 @@ void shouldOverrideUrlLoading() { ); await pageLoads.stream.first; // Wait for initial page load. - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await controller.evaluateJavascript( source: 'location.href = "$TEST_URL_2"'); diff --git a/example/integration_test/in_app_webview/ssl_request.dart b/example/integration_test/in_app_webview/ssl_request.dart index 094c1f20..27d0a1f7 100644 --- a/example/integration_test/in_app_webview/ssl_request.dart +++ b/example/integration_test/in_app_webview/ssl_request.dart @@ -10,8 +10,8 @@ void sslRequest() { ].contains(defaultTargetPlatform); skippableTestWidgets('SSL request', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( Directionality( @@ -40,7 +40,7 @@ void sslRequest() { ), ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; final String h1Content = await controller.evaluateJavascript( diff --git a/example/integration_test/in_app_webview/stop_loading.dart b/example/integration_test/in_app_webview/stop_loading.dart index a4c2c0d7..eb542bca 100644 --- a/example/integration_test/in_app_webview/stop_loading.dart +++ b/example/integration_test/in_app_webview/stop_loading.dart @@ -10,8 +10,8 @@ void stopLoading() { ].contains(defaultTargetPlatform); skippableTestWidgets('stopLoading', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -34,7 +34,7 @@ void stopLoading() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; if (defaultTargetPlatform == TargetPlatform.android) { await pageLoaded.future; diff --git a/example/integration_test/in_app_webview/t_rex_runner_game.dart b/example/integration_test/in_app_webview/t_rex_runner_game.dart index b1f98295..5dcdc237 100644 --- a/example/integration_test/in_app_webview/t_rex_runner_game.dart +++ b/example/integration_test/in_app_webview/t_rex_runner_game.dart @@ -10,8 +10,8 @@ void tRexRunnerGame() { ].contains(defaultTargetPlatform); skippableTestWidgets('T-Rex Runner game', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( diff --git a/example/integration_test/in_app_webview/take_screenshot.dart b/example/integration_test/in_app_webview/take_screenshot.dart index 49a126a1..d6d532d8 100644 --- a/example/integration_test/in_app_webview/take_screenshot.dart +++ b/example/integration_test/in_app_webview/take_screenshot.dart @@ -10,8 +10,8 @@ void takeScreenshot() { ].contains(defaultTargetPlatform); skippableTestWidgets('takeScreenshot', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -30,7 +30,7 @@ void takeScreenshot() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await Future.delayed(Duration(seconds: 1)); diff --git a/example/integration_test/in_app_webview/user_scripts.dart b/example/integration_test/in_app_webview/user_scripts.dart index 078218ca..a09ea97e 100644 --- a/example/integration_test/in_app_webview/user_scripts.dart +++ b/example/integration_test/in_app_webview/user_scripts.dart @@ -11,8 +11,8 @@ void userScripts() { skippableGroup('user scripts', () { skippableTestWidgets('initialUserScripts', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -47,7 +47,7 @@ void userScripts() { ), ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -71,8 +71,8 @@ void userScripts() { skippableTestWidgets('add/remove user scripts', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); @@ -92,7 +92,7 @@ void userScripts() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoads.stream.first; diff --git a/example/integration_test/in_app_webview/video_playback_policy.dart b/example/integration_test/in_app_webview/video_playback_policy.dart index 6188967c..6c56ad10 100644 --- a/example/integration_test/in_app_webview/video_playback_policy.dart +++ b/example/integration_test/in_app_webview/video_playback_policy.dart @@ -50,8 +50,8 @@ void videoPlaybackPolicy() { }); skippableTestWidgets('Auto media playback', (WidgetTester tester) async { - Completer controllerCompleter = - Completer(); + Completer controllerCompleter = + Completer(); Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -74,14 +74,14 @@ void videoPlaybackPolicy() { ), ), ); - InAppWebViewController controller = await controllerCompleter.future; + PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; bool isPaused = await controller.evaluateJavascript(source: 'isPaused();'); expect(isPaused, false); - controllerCompleter = Completer(); + controllerCompleter = Completer(); pageLoaded = Completer(); // We change the key to re-create a new webview as we change the mediaPlaybackRequiresUserGesture @@ -123,8 +123,8 @@ void videoPlaybackPolicy() { skippableTestWidgets( 'Video plays inline when allowsInlineMediaPlayback is true', (WidgetTester tester) async { - Completer controllerCompleter = - Completer(); + Completer controllerCompleter = + Completer(); Completer pageLoaded = Completer(); Completer onEnterFullscreenCompleter = Completer(); @@ -167,8 +167,8 @@ void videoPlaybackPolicy() { testWidgets( 'Video plays fullscreen when allowsInlineMediaPlayback is false', (WidgetTester tester) async { - Completer controllerCompleter = - Completer(); + Completer controllerCompleter = + Completer(); Completer pageLoaded = Completer(); Completer onEnterFullscreenCompleter = Completer(); @@ -212,8 +212,8 @@ void videoPlaybackPolicy() { ].contains(defaultTargetPlatform); // on Android, entering fullscreen requires user interaction skippableTestWidgets('exit fullscreen event', (WidgetTester tester) async { - Completer controllerCompleter = - Completer(); + Completer controllerCompleter = + Completer(); Completer pageLoaded = Completer(); Completer onExitFullscreenCompleter = Completer(); @@ -242,7 +242,7 @@ void videoPlaybackPolicy() { ), ); - InAppWebViewController controller = await controllerCompleter.future; + PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; await Future.delayed(Duration(seconds: 2)); diff --git a/example/integration_test/in_app_webview/web_archive.dart b/example/integration_test/in_app_webview/web_archive.dart index 914011ec..af237bc4 100644 --- a/example/integration_test/in_app_webview/web_archive.dart +++ b/example/integration_test/in_app_webview/web_archive.dart @@ -18,8 +18,8 @@ void webArchive() { ].contains(defaultTargetPlatform); skippableTestWidgets('create data', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -38,7 +38,7 @@ void webArchive() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; @@ -46,8 +46,8 @@ void webArchive() { }, skip: shouldSkipTest1); skippableTestWidgets('save', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -66,7 +66,7 @@ void webArchive() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoaded.future; diff --git a/example/integration_test/in_app_webview/web_history.dart b/example/integration_test/in_app_webview/web_history.dart index bfe9d7c9..10660a41 100644 --- a/example/integration_test/in_app_webview/web_history.dart +++ b/example/integration_test/in_app_webview/web_history.dart @@ -20,8 +20,8 @@ void webHistory() { skippableTestWidgets('get history list and go back/forward', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); await tester.pumpWidget( Directionality( @@ -39,7 +39,7 @@ void webHistory() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await Future.delayed(Duration(seconds: 1)); @@ -119,8 +119,8 @@ void webHistory() { skippableTestWidgets('go back/forward on web platform', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); @@ -140,7 +140,7 @@ void webHistory() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await tester.pump(); @@ -178,8 +178,8 @@ void webHistory() { ].contains(defaultTargetPlatform); skippableTestWidgets('clearHistory', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); @@ -199,7 +199,7 @@ void webHistory() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoads.stream.first; await controller.loadUrl(urlRequest: URLRequest(url: TEST_URL_1)); diff --git a/example/integration_test/in_app_webview/web_message.dart b/example/integration_test/in_app_webview/web_message.dart index 2deafb9f..fec8697c 100644 --- a/example/integration_test/in_app_webview/web_message.dart +++ b/example/integration_test/in_app_webview/web_message.dart @@ -12,8 +12,8 @@ void webMessage() { skippableGroup('WebMessage', () { skippableTestWidgets('WebMessageChannel post String', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer webMessageCompleter = Completer(); await tester.pumpWidget( Directionality( @@ -81,8 +81,8 @@ void webMessage() { skippableTestWidgets('WebMessageChannel post ArrayBuffer', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer webMessageCompleter = Completer(); await tester.pumpWidget( Directionality( @@ -167,8 +167,8 @@ void webMessage() { skippableTestWidgets('WebMessageListener post String', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer webMessageCompleter = Completer(); await tester.pumpWidget( @@ -177,7 +177,7 @@ void webMessage() { child: InAppWebView( key: GlobalKey(), onWebViewCreated: (controller) async { - await controller.addWebMessageListener(WebMessageListener( + await InAppWebViewController.fromPlatform(platform: controller).addWebMessageListener(WebMessageListener( jsObjectName: "myTestObj", allowedOriginRules: Set.from(["https://*.example.com"]), onPostMessage: @@ -222,8 +222,8 @@ void webMessage() { skippableTestWidgets('WebMessageListener post ArrayBuffer', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); final Completer webMessageCompleter = Completer(); await tester.pumpWidget( @@ -232,7 +232,7 @@ void webMessage() { child: InAppWebView( key: GlobalKey(), onWebViewCreated: (controller) async { - await controller.addWebMessageListener(WebMessageListener( + await InAppWebViewController.fromPlatform(platform: controller).addWebMessageListener(WebMessageListener( jsObjectName: "myTestObj", allowedOriginRules: Set.from(["https://*.example.com"]), onPostMessage: diff --git a/example/integration_test/in_app_webview/webview_asset_loader.dart b/example/integration_test/in_app_webview/webview_asset_loader.dart index 97f959c2..a0f48427 100644 --- a/example/integration_test/in_app_webview/webview_asset_loader.dart +++ b/example/integration_test/in_app_webview/webview_asset_loader.dart @@ -8,8 +8,8 @@ void webViewAssetLoader() { ].contains(defaultTargetPlatform); skippableTestWidgets('WebViewAssetLoader', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( @@ -25,7 +25,7 @@ void webViewAssetLoader() { allowContentAccess: false, webViewAssetLoader: WebViewAssetLoader( domain: TEST_WEBVIEW_ASSET_LOADER_DOMAIN, - pathHandlers: [AssetsPathHandler(path: '/assets/')])), + pathHandlers: [AssetsPathHandler(path: '/assets/')]).platform), onWebViewCreated: (controller) { controllerCompleter.complete(controller); }, @@ -36,7 +36,7 @@ void webViewAssetLoader() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; final url = await pageLoaded.future; expect(url, TEST_WEBVIEW_ASSET_LOADER_URL.toString()); diff --git a/example/integration_test/in_app_webview/webview_windows.dart b/example/integration_test/in_app_webview/webview_windows.dart index 1db16a35..33011964 100644 --- a/example/integration_test/in_app_webview/webview_windows.dart +++ b/example/integration_test/in_app_webview/webview_windows.dart @@ -20,8 +20,8 @@ void webViewWindows() { skippableTestWidgets('onCreateWindow return false', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); await tester.pumpWidget( Directionality( @@ -63,8 +63,8 @@ void webViewWindows() { skippableTestWidgets('onCreateWindow return true', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer onCreateWindowCompleter = Completer(); await tester.pumpWidget( Directionality( @@ -91,7 +91,7 @@ void webViewWindows() { var windowId = await onCreateWindowCompleter.future; final Completer windowControllerCompleter = - Completer(); + Completer(); final Completer windowPageLoaded = Completer(); final Completer onCloseWindowCompleter = Completer(); @@ -137,8 +137,8 @@ void webViewWindows() { skippableTestWidgets( 'window.open() with target _blank opens in same window', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); await tester.pumpWidget( @@ -160,7 +160,7 @@ void webViewWindows() { ), ); await pageLoads.stream.first; - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await controller.evaluateJavascript( @@ -181,8 +181,8 @@ void webViewWindows() { // on Android, for some reason, it works on an example app but not in this test skippableTestWidgets('can open new window and go back', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final StreamController pageLoads = StreamController.broadcast(); await tester.pumpWidget( @@ -205,7 +205,7 @@ void webViewWindows() { ), ); await pageLoads.stream.first; - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await tester.pump(); @@ -264,8 +264,8 @@ void webViewWindows() { '''; final String openWindowTestBase64 = base64Encode(const Utf8Encoder().convert(openWindowTest)); - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoadCompleter = Completer(); await tester.pumpWidget( @@ -290,7 +290,7 @@ void webViewWindows() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await pageLoadCompleter.future; @@ -309,8 +309,8 @@ void webViewWindows() { // on Web, opening a new window during tests makes crash skippableTestWidgets('onCreateWindow called on Web', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer onCreateWindowCalled = Completer(); await tester.pumpWidget( Directionality( @@ -334,7 +334,7 @@ void webViewWindows() { ), ); - final InAppWebViewController controller = + final PlatformInAppWebViewController controller = await controllerCompleter.future; await controller.evaluateJavascript( source: "window.open('$TEST_CROSS_PLATFORM_URL_1');"); diff --git a/example/integration_test/process_global_config/apply.dart b/example/integration_test/process_global_config/apply.dart index df32f723..285809cd 100644 --- a/example/integration_test/process_global_config/apply.dart +++ b/example/integration_test/process_global_config/apply.dart @@ -9,7 +9,7 @@ void apply() { skippableTestWidgets('apply', (WidgetTester tester) async { await expectLater( - PlatformProcessGlobalConfig.instance().apply( + ProcessGlobalConfig.instance().apply( settings: ProcessGlobalConfigSettings( dataDirectorySuffix: (await WebViewFeature.isStartupFeatureSupported( diff --git a/example/integration_test/proxy_controller/clear_and_set_proxy_override.dart b/example/integration_test/proxy_controller/clear_and_set_proxy_override.dart index 99601b05..31b1a3fe 100644 --- a/example/integration_test/proxy_controller/clear_and_set_proxy_override.dart +++ b/example/integration_test/proxy_controller/clear_and_set_proxy_override.dart @@ -9,15 +9,15 @@ void clearAndSetProxyOverride() { skippableTestWidgets('clear and set proxy override', (WidgetTester tester) async { - final Completer controllerCompleter = - Completer(); + final Completer controllerCompleter = + Completer(); final Completer pageLoaded = Completer(); var proxyAvailable = await WebViewFeature.isFeatureSupported(WebViewFeature.PROXY_OVERRIDE); if (proxyAvailable) { - PlatformProxyController proxyController = PlatformProxyController.instance(); + ProxyController proxyController = ProxyController.instance(); await proxyController.clearProxyOverride(); await proxyController.setProxyOverride( @@ -42,7 +42,7 @@ void clearAndSetProxyOverride() { ), ); - final InAppWebViewController controller = await controllerCompleter.future; + final PlatformInAppWebViewController controller = await controllerCompleter.future; final String url = await pageLoaded.future; expect(url, TEST_URL_HTTP_EXAMPLE.toString()); diff --git a/example/integration_test/service_worker_controller/set_service_worker_client.dart b/example/integration_test/service_worker_controller/set_service_worker_client.dart index 1c3baef1..30b8b4e4 100644 --- a/example/integration_test/service_worker_controller/set_service_worker_client.dart +++ b/example/integration_test/service_worker_controller/set_service_worker_client.dart @@ -17,8 +17,8 @@ void setServiceWorkerClient() { WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST); if (swAvailable && swInterceptAvailable) { - PlatformServiceWorkerController serviceWorkerController = - PlatformServiceWorkerController.instance(); + ServiceWorkerController serviceWorkerController = + ServiceWorkerController.instance(); await serviceWorkerController.setServiceWorkerClient(null); } diff --git a/example/integration_test/service_worker_controller/should_intercept_request.dart b/example/integration_test/service_worker_controller/should_intercept_request.dart index a7ff2df1..319f6e96 100644 --- a/example/integration_test/service_worker_controller/should_intercept_request.dart +++ b/example/integration_test/service_worker_controller/should_intercept_request.dart @@ -16,8 +16,8 @@ void shouldInterceptRequest() { WebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST); if (swAvailable && swInterceptAvailable) { - PlatformServiceWorkerController serviceWorkerController = - PlatformServiceWorkerController.instance(); + ServiceWorkerController serviceWorkerController = + ServiceWorkerController.instance(); await serviceWorkerController.setServiceWorkerClient(ServiceWorkerClient( shouldInterceptRequest: (request) async { diff --git a/example/integration_test/webview_flutter_test.dart b/example/integration_test/webview_flutter_test.dart index 00612ccd..d69e7550 100644 --- a/example/integration_test/webview_flutter_test.dart +++ b/example/integration_test/webview_flutter_test.dart @@ -18,8 +18,8 @@ import 'tracing_controller/main.dart' as tracing_controller_tests; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - WebView.debugLoggingSettings.usePrint = true; - WebView.debugLoggingSettings.maxLogMessageLength = 7000; + PlatformInAppWebViewController.debugLoggingSettings.usePrint = true; + PlatformInAppWebViewController.debugLoggingSettings.maxLogMessageLength = 7000; InAppBrowser.debugLoggingSettings.usePrint = true; InAppBrowser.debugLoggingSettings.maxLogMessageLength = 7000; PlatformChromeSafariBrowser.debugLoggingSettings.usePrint = true; diff --git a/example/lib/headless_in_app_webview.screen.dart b/example/lib/headless_in_app_webview.screen.dart index 34e5bf38..87e3dc20 100755 --- a/example/lib/headless_in_app_webview.screen.dart +++ b/example/lib/headless_in_app_webview.screen.dart @@ -7,7 +7,7 @@ import 'main.dart'; class HeadlessInAppWebViewExampleScreen extends StatefulWidget { @override _HeadlessInAppWebViewExampleScreenState createState() => - new _HeadlessInAppWebViewExampleScreenState(); + _HeadlessInAppWebViewExampleScreenState(); } class _HeadlessInAppWebViewExampleScreenState @@ -23,7 +23,7 @@ class _HeadlessInAppWebViewExampleScreenState ? WebUri("https://flutter.dev") : WebUri("http://localhost:${Uri.base.port}/page.html"); - headlessWebView = new HeadlessInAppWebView( + headlessWebView = HeadlessInAppWebView( initialUrlRequest: URLRequest(url: url), initialSettings: InAppWebViewSettings( isInspectable: kDebugMode, @@ -88,8 +88,9 @@ class _HeadlessInAppWebViewExampleScreenState child: ElevatedButton( onPressed: () async { if (headlessWebView?.isRunning() ?? false) { - await headlessWebView?.webViewController?.evaluateJavascript( - source: """console.log('Here is the message!');"""); + await headlessWebView?.webViewController + ?.evaluateJavascript( + source: """console.log('Here is the message!');"""); } else { ScaffoldMessenger.of(context).showSnackBar(SnackBar( content: Text( diff --git a/example/lib/in_app_browser_example.screen.dart b/example/lib/in_app_browser_example.screen.dart index 4c9b968d..11ee9852 100755 --- a/example/lib/in_app_browser_example.screen.dart +++ b/example/lib/in_app_browser_example.screen.dart @@ -66,7 +66,7 @@ class MyInAppBrowser extends InAppBrowser { class InAppBrowserExampleScreen extends StatefulWidget { @override _InAppBrowserExampleScreenState createState() => - new _InAppBrowserExampleScreenState(); + _InAppBrowserExampleScreenState(); } class _InAppBrowserExampleScreenState extends State { diff --git a/example/lib/in_app_webiew_example.screen.dart b/example/lib/in_app_webiew_example.screen.dart index aca062db..a45b8f67 100755 --- a/example/lib/in_app_webiew_example.screen.dart +++ b/example/lib/in_app_webiew_example.screen.dart @@ -9,7 +9,7 @@ import 'main.dart'; class InAppWebViewExampleScreen extends StatefulWidget { @override _InAppWebViewExampleScreenState createState() => - new _InAppWebViewExampleScreenState(); + _InAppWebViewExampleScreenState(); } class _InAppWebViewExampleScreenState extends State { diff --git a/example/lib/main.dart b/example/lib/main.dart index 0d9c4ce7..d4655513 100755 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -15,7 +15,7 @@ import 'package:pointer_interceptor/pointer_interceptor.dart'; // import 'package:permission_handler/permission_handler.dart'; InAppLocalhostServer localhostServer = - new InAppLocalhostServer(documentRoot: 'assets'); + InAppLocalhostServer(documentRoot: 'assets'); Future main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -130,7 +130,7 @@ PointerInterceptor myDrawer({required BuildContext context}) { class MyApp extends StatefulWidget { @override - _MyAppState createState() => new _MyAppState(); + _MyAppState createState() => _MyAppState(); } class _MyAppState extends State { diff --git a/example/lib/web_authentication_session_example.screen.dart b/example/lib/web_authentication_session_example.screen.dart index 1383b33f..761cf80d 100755 --- a/example/lib/web_authentication_session_example.screen.dart +++ b/example/lib/web_authentication_session_example.screen.dart @@ -12,7 +12,7 @@ class WebAuthenticationSessionExampleScreen extends StatefulWidget { class _WebAuthenticationSessionExampleScreenState extends State { - PlatformWebAuthenticationSession? session; + WebAuthenticationSession? session; String? token; @override diff --git a/flutter_inappwebview_android/example/integration_test/plugin_integration_test.dart b/flutter_inappwebview_android/example/integration_test/plugin_integration_test.dart index 2784454b..e69de29b 100644 --- a/flutter_inappwebview_android/example/integration_test/plugin_integration_test.dart +++ b/flutter_inappwebview_android/example/integration_test/plugin_integration_test.dart @@ -1,25 +0,0 @@ -// This is a basic Flutter integration test. -// -// Since integration tests run in a full Flutter application, they can interact -// with the host side of a plugin implementation, unlike Dart unit tests. -// -// For more information about Flutter integration tests, please see -// https://docs.flutter.dev/cookbook/testing/integration/introduction - - -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; - -import 'package:flutter_inappwebview_android/flutter_inappwebview_android.dart'; - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - testWidgets('getPlatformVersion test', (WidgetTester tester) async { - final FlutterInappwebviewAndroid plugin = FlutterInappwebviewAndroid(); - final String? version = await plugin.getPlatformVersion(); - // The version string depends on the host platform running the test, so - // just assert that some non-empty string is returned. - expect(version?.isNotEmpty, true); - }); -} diff --git a/flutter_inappwebview_android/example/lib/main.dart b/flutter_inappwebview_android/example/lib/main.dart index 80ee1023..e69de29b 100644 --- a/flutter_inappwebview_android/example/lib/main.dart +++ b/flutter_inappwebview_android/example/lib/main.dart @@ -1,63 +0,0 @@ -import 'package:flutter/material.dart'; -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:flutter_inappwebview_android/flutter_inappwebview_android.dart'; - -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatefulWidget { - const MyApp({super.key}); - - @override - State createState() => _MyAppState(); -} - -class _MyAppState extends State { - String _platformVersion = 'Unknown'; - final _flutterInappwebviewAndroidPlugin = FlutterInappwebviewAndroid(); - - @override - void initState() { - super.initState(); - initPlatformState(); - } - - // Platform messages are asynchronous, so we initialize in an async method. - Future initPlatformState() async { - String platformVersion; - // Platform messages may fail, so we use a try/catch PlatformException. - // We also handle the message potentially returning null. - try { - platformVersion = - await _flutterInappwebviewAndroidPlugin.getPlatformVersion() ?? 'Unknown platform version'; - } on PlatformException { - platformVersion = 'Failed to get platform version.'; - } - - // If the widget was removed from the tree while the asynchronous platform - // message was in flight, we want to discard the reply rather than calling - // setState to update our non-existent appearance. - if (!mounted) return; - - setState(() { - _platformVersion = platformVersion; - }); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('Plugin example app'), - ), - body: Center( - child: Text('Running on: $_platformVersion\n'), - ), - ), - ); - } -} diff --git a/flutter_inappwebview_android/example/test/widget_test.dart b/flutter_inappwebview_android/example/test/widget_test.dart index 60063477..e69de29b 100644 --- a/flutter_inappwebview_android/example/test/widget_test.dart +++ b/flutter_inappwebview_android/example/test/widget_test.dart @@ -1,27 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:flutter_inappwebview_android_example/main.dart'; - -void main() { - testWidgets('Verify Platform version', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that platform version is retrieved. - expect( - find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data!.startsWith('Running on:'), - ), - findsOneWidget, - ); - }); -} diff --git a/flutter_inappwebview_android/lib/src/in_app_webview/in_app_webview.dart b/flutter_inappwebview_android/lib/src/in_app_webview/in_app_webview.dart index 51582ab5..2680aec9 100755 --- a/flutter_inappwebview_android/lib/src/in_app_webview/in_app_webview.dart +++ b/flutter_inappwebview_android/lib/src/in_app_webview/in_app_webview.dart @@ -322,9 +322,7 @@ class AndroidInAppWebViewWidget extends PlatformInAppWebViewWidget { return PlatformViewLink( // Setting a default key using `params` ensures the `PlatformViewLink` // recreates the PlatformView when changes are made. - key: _androidParams.key ?? - ValueKey( - params as AndroidInAppWebViewWidgetCreationParams), + key: _androidParams.key, viewType: 'com.pichillilorenzo/flutter_inappwebview', surfaceFactory: ( BuildContext context, diff --git a/flutter_inappwebview_android/test/flutter_inappwebview_android_method_channel_test.dart b/flutter_inappwebview_android/test/flutter_inappwebview_android_method_channel_test.dart deleted file mode 100644 index 516d04a4..00000000 --- a/flutter_inappwebview_android/test/flutter_inappwebview_android_method_channel_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_inappwebview_android/flutter_inappwebview_android_method_channel.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - MethodChannelInAppWebViewFlutterAndroid platform = MethodChannelInAppWebViewFlutterAndroid(); - const MethodChannel channel = MethodChannel('flutter_inappwebview_android'); - - setUp(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler( - channel, - (MethodCall methodCall) async { - return '42'; - }, - ); - }); - - tearDown(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null); - }); - - test('getPlatformVersion', () async { - expect(await platform.getPlatformVersion(), '42'); - }); -} diff --git a/flutter_inappwebview_android/test/flutter_inappwebview_android_test.dart b/flutter_inappwebview_android/test/flutter_inappwebview_android_test.dart index 44503fdb..e69de29b 100644 --- a/flutter_inappwebview_android/test/flutter_inappwebview_android_test.dart +++ b/flutter_inappwebview_android/test/flutter_inappwebview_android_test.dart @@ -1,29 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:flutter_inappwebview_android/flutter_inappwebview_android.dart'; -import 'package:flutter_inappwebview_android/flutter_inappwebview_android_platform_interface.dart'; -import 'package:flutter_inappwebview_android/flutter_inappwebview_android_method_channel.dart'; -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -class MockFlutterInappwebviewAndroidPlatform - with MockPlatformInterfaceMixin - implements InAppWebViewFlutterAndroid { - - @override - Future getPlatformVersion() => Future.value('42'); -} - -void main() { - final InAppWebViewFlutterAndroid initialPlatform = InAppWebViewFlutterAndroid.instance; - - test('$MethodChannelInAppWebViewFlutterAndroid is the default instance', () { - expect(initialPlatform, isInstanceOf()); - }); - - test('getPlatformVersion', () async { - FlutterInappwebviewAndroid flutterInappwebviewAndroidPlugin = FlutterInappwebviewAndroid(); - MockFlutterInappwebviewAndroidPlatform fakePlatform = MockFlutterInappwebviewAndroidPlatform(); - InAppWebViewFlutterAndroid.instance = fakePlatform; - - expect(await flutterInappwebviewAndroidPlugin.getPlatformVersion(), '42'); - }); -} diff --git a/flutter_inappwebview_platform_interface/lib/src/in_app_localhost_server.dart b/flutter_inappwebview_platform_interface/lib/src/in_app_localhost_server.dart index 00485dca..26e2814a 100755 --- a/flutter_inappwebview_platform_interface/lib/src/in_app_localhost_server.dart +++ b/flutter_inappwebview_platform_interface/lib/src/in_app_localhost_server.dart @@ -2,9 +2,33 @@ import 'dart:io'; import 'dart:async'; import 'dart:typed_data'; +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart' show rootBundle; import 'mime_type_resolver.dart'; +import 'platform_in_app_localhost_server.dart'; + +/// Object specifying creation parameters for creating a [DefaultInAppLocalhostServer]. +/// +/// When adding additional fields make sure they can be null or have a default +/// value to avoid breaking changes. See [PlatformInAppLocalhostServerCreationParams] for +/// more information. +@immutable +class DefaultInAppLocalhostServerCreationParams + extends PlatformInAppLocalhostServerCreationParams { + /// Creates a new [DefaultInAppLocalhostServerCreationParams] instance. + const DefaultInAppLocalhostServerCreationParams( + // This parameter prevents breaking changes later. + // ignore: avoid_unused_constructor_parameters + PlatformInAppLocalhostServerCreationParams params, + ) : super(); + + /// Creates a [DefaultInAppLocalhostServerCreationParams] instance based on [PlatformInAppLocalhostServerCreationParams]. + factory DefaultInAppLocalhostServerCreationParams.fromPlatformInAppLocalhostServerCreationParams( + PlatformInAppLocalhostServerCreationParams params) { + return DefaultInAppLocalhostServerCreationParams(params); + } +} ///This class allows you to create a simple server on `http://localhost:[port]/` ///in order to be able to load your assets file on a local server. @@ -14,7 +38,7 @@ import 'mime_type_resolver.dart'; ///- Android native WebView ///- iOS ///- MacOS -class InAppLocalhostServer { +class DefaultInAppLocalhostServer extends PlatformInAppLocalhostServer { bool _started = false; HttpServer? _server; int _port = 8080; @@ -22,24 +46,14 @@ class InAppLocalhostServer { String _directoryIndex = 'index.html'; String _documentRoot = './'; - ///- [port] represents the port of the server. The default value is `8080`. - /// - ///- [directoryIndex] represents the index file to use. The default value is `index.html`. - /// - ///- [documentRoot] represents the document root path to serve. The default value is `./`. - /// - ///- The optional argument [shared] specifies whether additional `HttpServer` - /// objects can bind to the same combination of `address`, `port` and `v6Only`. - /// If `shared` is `true` and more `HttpServer`s from this isolate or other - /// isolates are bound to the port, then the incoming connections will be - /// distributed among all the bound `HttpServer`s. Connections can be - /// distributed over multiple isolates this way. - InAppLocalhostServer({ - int port = 8080, - String directoryIndex = 'index.html', - String documentRoot = './', - bool shared = false, - }) { + /// Creates a new [DefaultInAppLocalhostServer]. + DefaultInAppLocalhostServer(PlatformInAppLocalhostServerCreationParams params) + : super.implementation( + params is DefaultInAppLocalhostServerCreationParams + ? params + : DefaultInAppLocalhostServerCreationParams + .fromPlatformInAppLocalhostServerCreationParams(params), + ) { this._port = port; this._directoryIndex = directoryIndex; this._documentRoot = @@ -47,6 +61,18 @@ class InAppLocalhostServer { this._shared = shared; } + ///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.port} + int get port => _port; + + ///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.directoryIndex} + String get directoryIndex => _directoryIndex; + + ///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.documentRoot} + String get documentRoot => _documentRoot; + + ///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.shared} + bool get shared => _shared; + ///Starts the server on `http://localhost:[port]/`. /// ///**NOTE for iOS**: For the iOS Platform, you need to add the `NSAllowsLocalNetworking` key with `true` in the `Info.plist` file diff --git a/flutter_inappwebview_platform_interface/lib/src/in_app_webview/in_app_webview_settings.dart b/flutter_inappwebview_platform_interface/lib/src/in_app_webview/in_app_webview_settings.dart index dad28a65..f03914de 100755 --- a/flutter_inappwebview_platform_interface/lib/src/in_app_webview/in_app_webview_settings.dart +++ b/flutter_inappwebview_platform_interface/lib/src/in_app_webview/in_app_webview_settings.dart @@ -48,6 +48,16 @@ List _deserializeContentBlockers( return contentBlockers; } +Map? _serializeWebViewAssetLoader( + PlatformWebViewAssetLoader? webViewAssetLoader) { + return webViewAssetLoader?.toMap(); +} + +PlatformWebViewAssetLoader? _deserializeWebViewAssetLoader( + Map? map) { + return PlatformWebViewAssetLoader.static().fromMap(map); +} + ///This class represents all the WebView settings available. @ExchangeableObject(copyMethod: true) class InAppWebViewSettings_ { @@ -371,6 +381,9 @@ because there isn't any way to make the website data store non-persistent for th ///Use a [WebViewAssetLoader] instance to load local files including application's static assets and resources using http(s):// URLs. ///Loading local files using web-like URLs instead of `file://` is desirable as it is compatible with the Same-Origin policy. @SupportedPlatforms(platforms: [AndroidPlatform()]) + @ExchangeableObjectProperty( + serializer: _serializeWebViewAssetLoader, + deserializer: _deserializeWebViewAssetLoader) PlatformWebViewAssetLoader? webViewAssetLoader; ///Sets the text zoom of the page in percent. The default value is `100`. diff --git a/flutter_inappwebview_platform_interface/lib/src/in_app_webview/in_app_webview_settings.g.dart b/flutter_inappwebview_platform_interface/lib/src/in_app_webview/in_app_webview_settings.g.dart index 5654f1b9..fde15c1a 100644 --- a/flutter_inappwebview_platform_interface/lib/src/in_app_webview/in_app_webview_settings.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/in_app_webview/in_app_webview_settings.g.dart @@ -1404,7 +1404,8 @@ class InAppWebViewSettings { ? UtilColor.fromStringRepresentation( map['verticalScrollbarTrackColor']) : null, - webViewAssetLoader: map['webViewAssetLoader'], + webViewAssetLoader: + _deserializeWebViewAssetLoader(map['webViewAssetLoader']), ); instance.accessibilityIgnoresInvertColors = map['accessibilityIgnoresInvertColors']; @@ -1686,7 +1687,7 @@ class InAppWebViewSettings { "verticalScrollbarPosition": verticalScrollbarPosition?.toNativeValue(), "verticalScrollbarThumbColor": verticalScrollbarThumbColor?.toHex(), "verticalScrollbarTrackColor": verticalScrollbarTrackColor?.toHex(), - "webViewAssetLoader": webViewAssetLoader, + "webViewAssetLoader": _serializeWebViewAssetLoader(webViewAssetLoader), }; } diff --git a/flutter_inappwebview_platform_interface/lib/src/inappwebview_platform.dart b/flutter_inappwebview_platform_interface/lib/src/inappwebview_platform.dart index 33ef634d..d4fa05e8 100644 --- a/flutter_inappwebview_platform_interface/lib/src/inappwebview_platform.dart +++ b/flutter_inappwebview_platform_interface/lib/src/inappwebview_platform.dart @@ -7,6 +7,7 @@ import 'in_app_webview/platform_inappwebview_controller.dart'; import 'in_app_webview/platform_inappwebview_widget.dart'; import 'platform_cookie_manager.dart'; import 'platform_http_auth_credentials_database.dart'; +import 'platform_in_app_localhost_server.dart'; import 'print_job/platform_print_job_controller.dart'; import 'pull_to_refresh/platform_pull_to_refresh_controller.dart'; import 'web_authentication_session/platform_web_authenticate_session.dart'; @@ -21,6 +22,7 @@ import 'platform_service_worker_controller.dart'; import 'platform_tracing_controller.dart'; import 'platform_webview_asset_loader.dart'; import 'platform_webview_feature.dart'; +import 'in_app_localhost_server.dart'; /// Interface for a platform implementation of a WebView. abstract class InAppWebViewPlatform extends PlatformInterface { @@ -51,8 +53,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [CookieManager] in `flutter_inappwebview` instead. PlatformCookieManager createPlatformCookieManager( - PlatformCookieManagerCreationParams params, - ) { + PlatformCookieManagerCreationParams params, + ) { throw UnimplementedError( 'createPlatformCookieManager is not implemented on the current platform.'); } @@ -62,8 +64,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [InAppWebViewController] in `flutter_inappwebview` instead. PlatformInAppWebViewController createPlatformInAppWebViewController( - PlatformInAppWebViewControllerCreationParams params, - ) { + PlatformInAppWebViewControllerCreationParams params, + ) { throw UnimplementedError( 'createPlatformInAppWebViewController is not implemented on the current platform.'); } @@ -82,8 +84,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [InAppWebView] in `flutter_inappwebview` instead. PlatformInAppWebViewWidget createPlatformInAppWebViewWidget( - PlatformInAppWebViewWidgetCreationParams params, - ) { + PlatformInAppWebViewWidgetCreationParams params, + ) { throw UnimplementedError( 'createPlatformInAppWebViewWidget is not implemented on the current platform.'); } @@ -93,8 +95,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [FindInteractionController] in `flutter_inappwebview` instead. PlatformFindInteractionController createPlatformFindInteractionController( - PlatformFindInteractionControllerCreationParams params, - ) { + PlatformFindInteractionControllerCreationParams params, + ) { throw UnimplementedError( 'createPlatformFindInteractionController is not implemented on the current platform.'); } @@ -104,8 +106,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [PrintJobController] in `flutter_inappwebview` instead. PlatformPrintJobController createPlatformPrintJobController( - PlatformPrintJobControllerCreationParams params, - ) { + PlatformPrintJobControllerCreationParams params, + ) { throw UnimplementedError( 'createPlatformPrintJobController is not implemented on the current platform.'); } @@ -115,8 +117,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [PullToRefreshController] in `flutter_inappwebview` instead. PlatformPullToRefreshController createPlatformPullToRefreshController( - PlatformPullToRefreshControllerCreationParams params, - ) { + PlatformPullToRefreshControllerCreationParams params, + ) { throw UnimplementedError( 'createPlatformPullToRefreshController is not implemented on the current platform.'); } @@ -126,8 +128,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [WebAuthenticationSession] in `flutter_inappwebview` instead. PlatformWebAuthenticationSession createPlatformWebAuthenticationSession( - PlatformWebAuthenticationSessionCreationParams params, - ) { + PlatformWebAuthenticationSessionCreationParams params, + ) { throw UnimplementedError( 'createPlatformWebAuthenticationSession is not implemented on the current platform.'); } @@ -136,7 +138,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// /// This function should only be called by the app-facing package. /// Look at using [WebAuthenticationSession] in `flutter_inappwebview` instead. - PlatformWebAuthenticationSession createPlatformWebAuthenticationSessionStatic() { + PlatformWebAuthenticationSession + createPlatformWebAuthenticationSessionStatic() { throw UnimplementedError( 'createPlatformWebAuthenticationSessionStatic is not implemented on the current platform.'); } @@ -146,8 +149,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [WebMessageChannel] in `flutter_inappwebview` instead. PlatformWebMessageChannel createPlatformWebMessageChannel( - PlatformWebMessageChannelCreationParams params, - ) { + PlatformWebMessageChannelCreationParams params, + ) { throw UnimplementedError( 'createPlatformWebMessageChannel is not implemented on the current platform.'); } @@ -166,8 +169,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [WebMessageListener] in `flutter_inappwebview` instead. PlatformWebMessageListener createPlatformWebMessageListener( - PlatformWebMessageListenerCreationParams params, - ) { + PlatformWebMessageListenerCreationParams params, + ) { throw UnimplementedError( 'createPlatformWebMessageListener is not implemented on the current platform.'); } @@ -177,8 +180,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [JavaScriptReplyProxy] in `flutter_inappwebview` instead. PlatformJavaScriptReplyProxy createPlatformJavaScriptReplyProxy( - PlatformJavaScriptReplyProxyCreationParams params, - ) { + PlatformJavaScriptReplyProxyCreationParams params, + ) { throw UnimplementedError( 'createPlatformJavaScriptReplyProxy is not implemented on the current platform.'); } @@ -188,8 +191,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [WebMessagePort] in `flutter_inappwebview` instead. PlatformWebMessagePort createPlatformWebMessagePort( - PlatformWebMessagePortCreationParams params, - ) { + PlatformWebMessagePortCreationParams params, + ) { throw UnimplementedError( 'createPlatformWebMessagePort is not implemented on the current platform.'); } @@ -199,8 +202,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [WebStorage] in `flutter_inappwebview` instead. PlatformWebStorage createPlatformWebStorage( - PlatformWebStorageCreationParams params, - ) { + PlatformWebStorageCreationParams params, + ) { throw UnimplementedError( 'createPlatformWebStorage is not implemented on the current platform.'); } @@ -210,8 +213,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [Storage] in `flutter_inappwebview` instead. PlatformStorage createPlatformStorage( - PlatformStorageCreationParams params, - ) { + PlatformStorageCreationParams params, + ) { throw UnimplementedError( 'createPlatformStorage is not implemented on the current platform.'); } @@ -221,8 +224,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [LocalStorage] in `flutter_inappwebview` instead. PlatformLocalStorage createPlatformLocalStorage( - PlatformLocalStorageCreationParams params, - ) { + PlatformLocalStorageCreationParams params, + ) { throw UnimplementedError( 'createPlatformLocalStorage is not implemented on the current platform.'); } @@ -232,8 +235,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [PlatformSessionStorage] in `flutter_inappwebview` instead. PlatformSessionStorage createPlatformSessionStorage( - PlatformSessionStorageCreationParams params, - ) { + PlatformSessionStorageCreationParams params, + ) { throw UnimplementedError( 'createPlatformSessionStorage is not implemented on the current platform.'); } @@ -243,8 +246,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [HeadlessInAppWebView] in `flutter_inappwebview` instead. PlatformHeadlessInAppWebView createPlatformHeadlessInAppWebView( - PlatformHeadlessInAppWebViewCreationParams params, - ) { + PlatformHeadlessInAppWebViewCreationParams params, + ) { throw UnimplementedError( 'createPlatformHeadlessInAppWebView is not implemented on the current platform.'); } @@ -254,8 +257,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [CookieManager] in `flutter_inappwebview` instead. PlatformWebStorageManager createPlatformWebStorageManager( - PlatformWebStorageManagerCreationParams params, - ) { + PlatformWebStorageManagerCreationParams params, + ) { throw UnimplementedError( 'createPlatformWebStorageManager is not implemented on the current platform.'); } @@ -265,8 +268,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [HttpAuthCredentialDatabase] in `flutter_inappwebview` instead. PlatformHttpAuthCredentialDatabase createPlatformHttpAuthCredentialDatabase( - PlatformHttpAuthCredentialDatabaseCreationParams params, - ) { + PlatformHttpAuthCredentialDatabaseCreationParams params, + ) { throw UnimplementedError( 'createPlatformHttpAuthCredentialDatabase is not implemented on the current platform.'); } @@ -276,8 +279,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [InAppBrowser] in `flutter_inappwebview` instead. PlatformInAppBrowser createPlatformInAppBrowser( - PlatformInAppBrowserCreationParams params, - ) { + PlatformInAppBrowserCreationParams params, + ) { throw UnimplementedError( 'createPlatformInAppBrowser is not implemented on the current platform.'); } @@ -296,8 +299,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [ProcessGlobalConfig] in `flutter_inappwebview` instead. PlatformProcessGlobalConfig createPlatformProcessGlobalConfig( - PlatformProcessGlobalConfigCreationParams params, - ) { + PlatformProcessGlobalConfigCreationParams params, + ) { throw UnimplementedError( 'createPlatformProcessGlobalConfig is not implemented on the current platform.'); } @@ -307,8 +310,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [ProxyController] in `flutter_inappwebview` instead. PlatformProxyController createPlatformProxyController( - PlatformProxyControllerCreationParams params, - ) { + PlatformProxyControllerCreationParams params, + ) { throw UnimplementedError( 'createPlatformProxyController is not implemented on the current platform.'); } @@ -318,8 +321,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [ServiceWorkerController] in `flutter_inappwebview` instead. PlatformServiceWorkerController createPlatformServiceWorkerController( - PlatformServiceWorkerControllerCreationParams params, - ) { + PlatformServiceWorkerControllerCreationParams params, + ) { throw UnimplementedError( 'createPlatformServiceWorkerController is not implemented on the current platform.'); } @@ -328,7 +331,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// /// This function should only be called by the app-facing package. /// Look at using [ServiceWorkerController] in `flutter_inappwebview` instead. - PlatformServiceWorkerController createPlatformServiceWorkerControllerStatic() { + PlatformServiceWorkerController + createPlatformServiceWorkerControllerStatic() { throw UnimplementedError( 'createPlatformServiceWorkerControllerStatic is not implemented on the current platform.'); } @@ -338,8 +342,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [TracingController] in `flutter_inappwebview` instead. PlatformTracingController createPlatformTracingController( - PlatformTracingControllerCreationParams params, - ) { + PlatformTracingControllerCreationParams params, + ) { throw UnimplementedError( 'createPlatformTracingController is not implemented on the current platform.'); } @@ -349,8 +353,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [WebViewAssetLoader] in `flutter_inappwebview` instead. PlatformWebViewAssetLoader createPlatformWebViewAssetLoader( - PlatformWebViewAssetLoaderCreationParams params, - ) { + PlatformWebViewAssetLoaderCreationParams params, + ) { throw UnimplementedError( 'createPlatformWebViewAssetLoader is not implemented on the current platform.'); } @@ -369,8 +373,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [PathHandler] in `flutter_inappwebview` instead. PlatformPathHandler createPlatformPathHandler( - PlatformPathHandlerCreationParams params, - ) { + PlatformPathHandlerCreationParams params, + ) { throw UnimplementedError( 'createPlatformPathHandler is not implemented on the current platform.'); } @@ -380,8 +384,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [AssetsPathHandler] in `flutter_inappwebview` instead. PlatformAssetsPathHandler createPlatformAssetsPathHandler( - PlatformAssetsPathHandlerCreationParams params, - ) { + PlatformAssetsPathHandlerCreationParams params, + ) { throw UnimplementedError( 'createPlatformAssetsPathHandler is not implemented on the current platform.'); } @@ -391,8 +395,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [ResourcesPathHandler] in `flutter_inappwebview` instead. PlatformResourcesPathHandler createPlatformResourcesPathHandler( - PlatformResourcesPathHandlerCreationParams params, - ) { + PlatformResourcesPathHandlerCreationParams params, + ) { throw UnimplementedError( 'createPlatformResourcesPathHandler is not implemented on the current platform.'); } @@ -402,8 +406,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [InternalStoragePathHandler] in `flutter_inappwebview` instead. PlatformInternalStoragePathHandler createPlatformInternalStoragePathHandler( - PlatformInternalStoragePathHandlerCreationParams params, - ) { + PlatformInternalStoragePathHandlerCreationParams params, + ) { throw UnimplementedError( 'createPlatformInternalStoragePathHandler is not implemented on the current platform.'); } @@ -413,8 +417,8 @@ abstract class InAppWebViewPlatform extends PlatformInterface { /// This function should only be called by the app-facing package. /// Look at using [WebViewFeature] in `flutter_inappwebview` instead. PlatformWebViewFeature createPlatformWebViewFeature( - PlatformWebViewFeatureCreationParams params, - ) { + PlatformWebViewFeatureCreationParams params, + ) { throw UnimplementedError( 'createPlatformWebViewFeature is not implemented on the current platform.'); } @@ -427,4 +431,13 @@ abstract class InAppWebViewPlatform extends PlatformInterface { throw UnimplementedError( 'createPlatformWebViewFeatureStatic is not implemented on the current platform.'); } + + /// Creates a new empty [PlatformInAppLocalhostServer] to access static methods. + /// + /// This function should only be called by the app-facing package. + /// Look at using [DefaultInAppLocalhostServer] in `flutter_inappwebview` instead. + PlatformInAppLocalhostServer createPlatformInAppLocalhostServer( + PlatformInAppLocalhostServerCreationParams params) { + return DefaultInAppLocalhostServer(params); + } } diff --git a/flutter_inappwebview_platform_interface/lib/src/main.dart b/flutter_inappwebview_platform_interface/lib/src/main.dart index 8bbab06e..5b8d6cb7 100644 --- a/flutter_inappwebview_platform_interface/lib/src/main.dart +++ b/flutter_inappwebview_platform_interface/lib/src/main.dart @@ -6,7 +6,6 @@ export 'chrome_safari_browser/main.dart'; export 'x509_certificate/main.dart'; export 'web_storage/main.dart'; export 'platform_cookie_manager.dart'; -export 'in_app_localhost_server.dart'; export 'content_blocker.dart'; export 'platform_http_auth_credentials_database.dart'; export 'context_menu/main.dart'; @@ -22,13 +21,9 @@ export 'platform_service_worker_controller.dart'; export 'platform_webview_feature.dart' hide WebViewFeature_, AndroidWebViewFeature_; export 'platform_proxy_controller.dart' hide ProxySettings_; -export 'platform_webview_asset_loader.dart' - hide - PlatformWebViewAssetLoader_, - PlatformPathHandler_, - PlatformAssetsPathHandler_, - PlatformResourcesPathHandler_, - PlatformInternalStoragePathHandler_; +export 'platform_webview_asset_loader.dart'; export 'platform_tracing_controller.dart' hide TracingSettings_; export 'platform_process_global_config.dart' hide ProcessGlobalConfigSettings_, ProcessGlobalConfigDirectoryBasePaths_; +export 'platform_in_app_localhost_server.dart'; +export 'in_app_localhost_server.dart'; diff --git a/flutter_inappwebview_platform_interface/lib/src/platform_in_app_localhost_server.dart b/flutter_inappwebview_platform_interface/lib/src/platform_in_app_localhost_server.dart new file mode 100755 index 00000000..9217e32e --- /dev/null +++ b/flutter_inappwebview_platform_interface/lib/src/platform_in_app_localhost_server.dart @@ -0,0 +1,125 @@ +import 'dart:async'; + +import 'package:flutter/foundation.dart'; +import 'package:flutter_inappwebview_platform_interface/flutter_inappwebview_platform_interface.dart'; +import 'package:plugin_platform_interface/plugin_platform_interface.dart'; + +/// Object specifying creation parameters for creating a [PlatformInAppLocalhostServer]. +/// +/// Platform specific implementations can add additional fields by extending +/// this class. +@immutable +class PlatformInAppLocalhostServerCreationParams { + /// Used by the platform implementation to create a new [PlatformInAppLocalhostServer]. + const PlatformInAppLocalhostServerCreationParams({ + this.port = 8080, + this.directoryIndex = 'index.html', + this.documentRoot = './', + this.shared = false, + }); + + ///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.port} + final int port; + + ///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.directoryIndex} + final String directoryIndex; + + ///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.documentRoot} + final String documentRoot; + + ///{@macro flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.shared} + final bool shared; +} + +///This class allows you to create a simple server on `http://localhost:[port]/` +///in order to be able to load your assets file on a local server. +///The default `port` value is `8080`. +/// +///**Supported Platforms/Implementations**: +///- Android native WebView +///- iOS +///- MacOS +abstract class PlatformInAppLocalhostServer extends PlatformInterface { + /// Creates a new [PlatformInAppLocalhostServer] + factory PlatformInAppLocalhostServer(PlatformInAppLocalhostServerCreationParams params) { + assert( + InAppWebViewPlatform.instance != null, + 'A platform implementation for `flutter_inappwebview` has not been set. Please ' + 'ensure that an implementation of `InAppWebViewPlatform` has been set to ' + '`WebViewPlatform.instance` before use. For unit testing, ' + '`WebViewPlatform.instance` can be set with your own test implementation.', + ); + final PlatformInAppLocalhostServer inAppLocalhostServer = + InAppWebViewPlatform.instance!.createPlatformInAppLocalhostServer(params); + PlatformInterface.verify(inAppLocalhostServer, _token); + return inAppLocalhostServer; + } + + /// Used by the platform implementation to create a new + /// [PlatformInAppLocalhostServer]. + /// + /// Should only be used by platform implementations because they can't extend + /// a class that only contains a factory constructor. + @protected + PlatformInAppLocalhostServer.implementation(this.params) + : super(token: _token); + + static final Object _token = Object(); + + /// The parameters used to initialize the [PlatformInAppLocalhostServer]. + final PlatformInAppLocalhostServerCreationParams params; + + ///{@template flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.port} + ///Represents the port of the server. The default value is `8080`. + ///{@endtemplate} + int get port => params.port; + + ///{@template flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.directoryIndex} + ///represents the index file to use. The default value is `index.html`. + ///{@endtemplate} + String get directoryIndex => params.directoryIndex; + + ///{@template flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.documentRoot} + ///Represents the document root path to serve. The default value is `./`. + ///{@endtemplate} + String get documentRoot => params.documentRoot; + + ///{@template flutter_inappwebview_platform_interface.PlatformInAppLocalhostServer.shared} + ///Specifies whether additional `HttpServer` + /// objects can bind to the same combination of `address`, `port` and `v6Only`. + /// If `shared` is `true` and more `HttpServer`s from this isolate or other + /// isolates are bound to the port, then the incoming connections will be + /// distributed among all the bound `HttpServer`s. Connections can be + /// distributed over multiple isolates this way. + ///{@endtemplate} + bool get shared => params.shared; + + ///Starts the server on `http://localhost:[port]/`. + /// + ///**NOTE for iOS**: For the iOS Platform, you need to add the `NSAllowsLocalNetworking` key with `true` in the `Info.plist` file + ///(See [ATS Configuration Basics](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW35)): + ///```xml + ///NSAppTransportSecurity + /// + /// NSAllowsLocalNetworking + /// + /// + ///``` + ///The `NSAllowsLocalNetworking` key is available since **iOS 10**. + Future start() { + throw UnimplementedError( + 'start is not implemented on the current platform'); + } + + ///Closes the server. + Future close() { + throw UnimplementedError( + 'close is not implemented on the current platform'); + } + + ///Indicates if the server is running or not. + bool isRunning() { + throw UnimplementedError( + 'isRunning is not implemented on the current platform'); + } +} diff --git a/flutter_inappwebview_platform_interface/lib/src/platform_webview_asset_loader.dart b/flutter_inappwebview_platform_interface/lib/src/platform_webview_asset_loader.dart index 2bc3ca87..08557609 100644 --- a/flutter_inappwebview_platform_interface/lib/src/platform_webview_asset_loader.dart +++ b/flutter_inappwebview_platform_interface/lib/src/platform_webview_asset_loader.dart @@ -104,7 +104,7 @@ abstract class PlatformWebViewAssetLoader extends PlatformInterface { /// The parameters used to initialize the [PlatformWebViewAssetLoader]. final PlatformWebViewAssetLoaderCreationParams params; - PlatformWebViewAssetLoader? fromMap(Map map) { + PlatformWebViewAssetLoader? fromMap(Map? map) { throw UnimplementedError( 'fromMap is not implemented on the current platform'); } diff --git a/flutter_inappwebview_platform_interface/lib/src/platform_webview_feature.dart b/flutter_inappwebview_platform_interface/lib/src/platform_webview_feature.dart index cda9d23a..05fb46f8 100644 --- a/flutter_inappwebview_platform_interface/lib/src/platform_webview_feature.dart +++ b/flutter_inappwebview_platform_interface/lib/src/platform_webview_feature.dart @@ -331,6 +331,41 @@ class WebViewFeature_ { static const STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS = const WebViewFeature_._internal( "STARTUP_FEATURE_SET_DIRECTORY_BASE_PATHS"); + + ///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, + ///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device, + ///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`. + /// + ///**Note**: This method is different from [isStartupFeatureSupported] and this + ///method only accepts certain features. + ///Please verify that the correct feature checking method is used for a particular feature. + /// + ///**Note**: If this method returns `false`, it is not safe to invoke the methods + ///requiring the desired feature. + ///Furthermore, if this method returns `false` for a particular feature, any callback guarded by that feature will not be invoked. + /// + ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) + static Future isFeatureSupported(WebViewFeature feature) => + PlatformWebViewFeature.static().isFeatureSupported(feature); + + ///Return whether a startup feature is supported at run-time. + ///On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, + ///this will check whether a startup feature is supported, + ///depending on the combination of the desired feature, + ///the Android version of device, and the WebView APK on the device. + ///If running on a device with a lower API level, this will always return `false`. + /// + ///**Note**: This method is different from [isFeatureSupported] and this method only accepts startup features. + ///Please verify that the correct feature checking method is used for a particular feature. + /// + ///**Note**: If this method returns `false`, it is not safe to invoke the methods requiring the desired feature. + ///Furthermore, if this method returns `false` for a particular feature, + ///any callback guarded by that feature will not be invoked. + /// + ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) + static Future isStartupFeatureSupported( + WebViewFeature startupFeature) => + PlatformWebViewFeature.static().isStartupFeatureSupported(startupFeature); } ///Class that represents an Android-specific utility class for checking which WebView Support Library features are supported on the device. @@ -540,4 +575,13 @@ class AndroidWebViewFeature_ { static const ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY = const AndroidWebViewFeature_._internal( "ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY"); + + ///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, + ///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device, + ///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`. + /// + ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) + static Future isFeatureSupported(AndroidWebViewFeature feature) => + PlatformWebViewFeature.static().isFeatureSupported( + WebViewFeature.fromNativeValue(feature.toNativeValue())!); } \ No newline at end of file diff --git a/flutter_inappwebview_platform_interface/lib/src/platform_webview_feature.g.dart b/flutter_inappwebview_platform_interface/lib/src/platform_webview_feature.g.dart index 2a58157b..ee1138b7 100644 --- a/flutter_inappwebview_platform_interface/lib/src/platform_webview_feature.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/platform_webview_feature.g.dart @@ -320,6 +320,41 @@ class WebViewFeature { return null; } + ///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, + ///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device, + ///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`. + /// + ///**Note**: This method is different from [isStartupFeatureSupported] and this + ///method only accepts certain features. + ///Please verify that the correct feature checking method is used for a particular feature. + /// + ///**Note**: If this method returns `false`, it is not safe to invoke the methods + ///requiring the desired feature. + ///Furthermore, if this method returns `false` for a particular feature, any callback guarded by that feature will not be invoked. + /// + ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) + static Future isFeatureSupported(WebViewFeature feature) => + PlatformWebViewFeature.static().isFeatureSupported(feature); + + ///Return whether a startup feature is supported at run-time. + ///On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, + ///this will check whether a startup feature is supported, + ///depending on the combination of the desired feature, + ///the Android version of device, and the WebView APK on the device. + ///If running on a device with a lower API level, this will always return `false`. + /// + ///**Note**: This method is different from [isFeatureSupported] and this method only accepts startup features. + ///Please verify that the correct feature checking method is used for a particular feature. + /// + ///**Note**: If this method returns `false`, it is not safe to invoke the methods requiring the desired feature. + ///Furthermore, if this method returns `false` for a particular feature, + ///any callback guarded by that feature will not be invoked. + /// + ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) + static Future isStartupFeatureSupported( + WebViewFeature startupFeature) => + PlatformWebViewFeature.static().isStartupFeatureSupported(startupFeature); + ///Gets [String] value. String toValue() => _value; @@ -624,6 +659,15 @@ class AndroidWebViewFeature { return null; } + ///Return whether a feature is supported at run-time. On devices running Android version `Build.VERSION_CODES.LOLLIPOP` and higher, + ///this will check whether a feature is supported, depending on the combination of the desired feature, the Android version of device, + ///and the WebView APK on the device. If running on a device with a lower API level, this will always return `false`. + /// + ///**Official Android API**: https://developer.android.com/reference/androidx/webkit/WebViewFeature#isFeatureSupported(java.lang.String) + static Future isFeatureSupported(AndroidWebViewFeature feature) => + PlatformWebViewFeature.static().isFeatureSupported( + WebViewFeature.fromNativeValue(feature.toNativeValue())!); + ///Gets [String] value. String toValue() => _value; diff --git a/flutter_inappwebview_platform_interface/lib/src/types/call_async_javascript_result.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/call_async_javascript_result.g.dart index a049b4d3..68e40a66 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/call_async_javascript_result.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/call_async_javascript_result.g.dart @@ -6,7 +6,7 @@ part of 'call_async_javascript_result.dart'; // ExchangeableObjectGenerator // ************************************************************************** -///Class that represents either a success or a failure, including an associated value in each case for [InAppWebViewController.callAsyncJavaScript]. +///Class that represents either a success or a failure, including an associated value in each case for [PlatformInAppWebViewController.callAsyncJavaScript]. class CallAsyncJavaScriptResult { ///It contains the failure value. String? error; diff --git a/flutter_inappwebview_platform_interface/lib/src/types/css_link_html_tag_attributes.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/css_link_html_tag_attributes.g.dart index 006f8557..19aca09d 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/css_link_html_tag_attributes.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/css_link_html_tag_attributes.g.dart @@ -6,7 +6,7 @@ part of 'css_link_html_tag_attributes.dart'; // ExchangeableObjectGenerator // ************************************************************************** -///Class that represents the possible CSS stylesheet `` HTML attributes to be set used by [InAppWebViewController.injectCSSFileFromUrl]. +///Class that represents the possible CSS stylesheet `` HTML attributes to be set used by [PlatformInAppWebViewController.injectCSSFileFromUrl]. class CSSLinkHtmlTagAttributes { ///Specify alternative style sheets. bool? alternate; diff --git a/flutter_inappwebview_platform_interface/lib/src/types/favicon.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/favicon.g.dart index 900ed117..503ea60f 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/favicon.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/favicon.g.dart @@ -6,7 +6,7 @@ part of 'favicon.dart'; // ExchangeableObjectGenerator // ************************************************************************** -///Class that represents a favicon of a website. It is used by [InAppWebViewController.getFavicons] method. +///Class that represents a favicon of a website. It is used by [PlatformInAppWebViewController.getFavicons] method. class Favicon { ///The height of the favicon image. int? height; diff --git a/flutter_inappwebview_platform_interface/lib/src/types/meta_tag.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/meta_tag.g.dart index fccb4279..cbbd3505 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/meta_tag.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/meta_tag.g.dart @@ -6,7 +6,7 @@ part of 'meta_tag.dart'; // ExchangeableObjectGenerator // ************************************************************************** -///Class that represents a `` HTML tag. It is used by the [InAppWebViewController.getMetaTags] method. +///Class that represents a `` HTML tag. It is used by the [PlatformInAppWebViewController.getMetaTags] method. class MetaTag { ///The meta tag attributes list. List? attrs; diff --git a/flutter_inappwebview_platform_interface/lib/src/types/request_focus_node_href_result.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/request_focus_node_href_result.g.dart index a25e285b..57c85940 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/request_focus_node_href_result.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/request_focus_node_href_result.g.dart @@ -6,7 +6,7 @@ part of 'request_focus_node_href_result.dart'; // ExchangeableObjectGenerator // ************************************************************************** -///Class that represents the result used by the [InAppWebViewController.requestFocusNodeHref] method. +///Class that represents the result used by the [PlatformInAppWebViewController.requestFocusNodeHref] method. class RequestFocusNodeHrefResult { ///The image's src attribute. String? src; diff --git a/flutter_inappwebview_platform_interface/lib/src/types/request_image_ref_result.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/request_image_ref_result.g.dart index 99262626..bb42cf51 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/request_image_ref_result.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/request_image_ref_result.g.dart @@ -6,7 +6,7 @@ part of 'request_image_ref_result.dart'; // ExchangeableObjectGenerator // ************************************************************************** -///Class that represents the result used by the [InAppWebViewController.requestImageRef] method. +///Class that represents the result used by the [PlatformInAppWebViewController.requestImageRef] method. class RequestImageRefResult { ///The image's url. WebUri? url; diff --git a/flutter_inappwebview_platform_interface/lib/src/types/safe_browsing_response.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/safe_browsing_response.g.dart index 6a10a9df..8946a652 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/safe_browsing_response.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/safe_browsing_response.g.dart @@ -12,7 +12,7 @@ class SafeBrowsingResponse { ///Indicate the [SafeBrowsingResponseAction] to take when hitting a malicious URL. SafeBrowsingResponseAction? action; - ///If reporting is enabled, all reports will be sent according to the privacy policy referenced by [InAppWebViewController.getSafeBrowsingPrivacyPolicyUrl]. + ///If reporting is enabled, all reports will be sent according to the privacy policy referenced by [PlatformInAppWebViewController.getSafeBrowsingPrivacyPolicyUrl]. bool report; SafeBrowsingResponse( {this.action = SafeBrowsingResponseAction.SHOW_INTERSTITIAL, diff --git a/flutter_inappwebview_platform_interface/lib/src/types/screenshot_configuration.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/screenshot_configuration.g.dart index 9ce7f445..1a22c107 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/screenshot_configuration.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/screenshot_configuration.g.dart @@ -6,7 +6,7 @@ part of 'screenshot_configuration.dart'; // ExchangeableObjectGenerator // ************************************************************************** -///Class that represents the configuration data to use when generating an image from a web view’s contents using [InAppWebViewController.takeScreenshot]. +///Class that represents the configuration data to use when generating an image from a web view’s contents using [PlatformInAppWebViewController.takeScreenshot]. class ScreenshotConfiguration { ///A Boolean value that indicates whether to take the snapshot after incorporating any pending screen updates. ///The default value of this property is `true`, which causes the web view to incorporate any recent changes to the view’s content and then generate the snapshot. diff --git a/flutter_inappwebview_platform_interface/lib/src/types/script_html_tag_attributes.g.dart b/flutter_inappwebview_platform_interface/lib/src/types/script_html_tag_attributes.g.dart index 98a726dd..4ca72507 100644 --- a/flutter_inappwebview_platform_interface/lib/src/types/script_html_tag_attributes.g.dart +++ b/flutter_inappwebview_platform_interface/lib/src/types/script_html_tag_attributes.g.dart @@ -6,7 +6,7 @@ part of 'script_html_tag_attributes.dart'; // ExchangeableObjectGenerator // ************************************************************************** -///Class that represents the possible the `