diff --git a/.ci.yaml b/.ci.yaml index 0bb2ae374846..9163e5d53500 100644 --- a/.ci.yaml +++ b/.ci.yaml @@ -85,7 +85,7 @@ platform_properties: [ {"dependency": "ruby", "version": "ruby_3.1-pod_1.13"} ] - os: Mac-12|Mac-13 + os: "Mac-12" device_type: none cpu: arm64 # TODO(vashworth): Remove specific toolchain_ver once https://github.com/flutter/flutter/issues/138109 is resolved. @@ -101,7 +101,7 @@ platform_properties: [ {"dependency": "ruby", "version": "ruby_3.1-pod_1.13"} ] - os: Mac-12|Mac-13 + os: "Mac-12" device_type: none cpu: x86 # TODO(vashworth): Remove specific toolchain_ver once https://github.com/flutter/flutter/issues/138109 is resolved. @@ -1098,19 +1098,6 @@ targets: - name: Windows_x64 windows-build_all_packages stable recipe: packages/packages timeout: 30 - properties: - target_file: windows_build_all_packages.yaml - channel: stable - version_file: flutter_stable.version - dependencies: > - [ - {"dependency": "vs_build", "version": "version:vs2019"} - ] - - - name: Windows_arm64 windows-build_all_packages stable - recipe: packages/packages - timeout: 30 - bringup: true properties: add_recipes_cq: "true" target_file: windows_build_all_packages.yaml diff --git a/.ci/flutter_master.version b/.ci/flutter_master.version index 1ddec7845b7b..7c69d80360c7 100644 --- a/.ci/flutter_master.version +++ b/.ci/flutter_master.version @@ -1 +1 @@ -0eb788134051dd62c28d49cda7ea396f8750e18f +9c9e0617b1498104b1c4128d8729a7815254f533 diff --git a/.ci/flutter_stable.version b/.ci/flutter_stable.version index e1687636e4fa..ac067af632fa 100644 --- a/.ci/flutter_stable.version +++ b/.ci/flutter_stable.version @@ -1 +1 @@ -2e9cb0aa71a386a91f73f7088d115c0d96654829 +db7ef5bf9f59442b0e200a90587e8fa5e0c6336a diff --git a/.ci/scripts/update_pods.sh b/.ci/scripts/update_pods.sh deleted file mode 100755 index 79cd0699aed7..000000000000 --- a/.ci/scripts/update_pods.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -# Copyright 2013 The Flutter Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -set -e - -# Ensure that the pods repos are up to date, since analyze will not check for -# the latest versions of pods, so can use stale Flutter or FlutterMacOS pods -# for analysis otherwise. -pod repo update --verbose diff --git a/.ci/targets/macos_check_podspecs.yaml b/.ci/targets/macos_check_podspecs.yaml index 946ac66f748a..9df7e66afd41 100644 --- a/.ci/targets/macos_check_podspecs.yaml +++ b/.ci/targets/macos_check_podspecs.yaml @@ -2,9 +2,6 @@ tasks: - name: prepare tool script: .ci/scripts/prepare_tool.sh infra_step: true # Note infra steps failing prevents "always" from running. - - name: update pods repo - script: .ci/scripts/update_pods.sh - infra_step: true # Note infra steps failing prevents "always" from running. - name: validate iOS and macOS podspecs script: script/tool_runner.sh args: ["podspec-check"] diff --git a/.github/labeler.yml b/.github/labeler.yml index a6b295e01668..7bbdbd10c4dd 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,243 +1,149 @@ 'p: animations': - - changed-files: - - any-glob-to-any-file: - - packages/animations/**/* + - packages/animations/**/* 'p: camera': - - changed-files: - - any-glob-to-any-file: - - packages/camera/**/* + - packages/camera/**/* 'p: cross_file': - - changed-files: - - any-glob-to-any-file: - - packages/cross_file/**/* + - packages/cross_file/**/* 'p: css_colors': - - changed-files: - - any-glob-to-any-file: - - packages/css_colors/**/* + - packages/css_colors/**/* 'p: cupertino_icons': - - changed-files: - - any-glob-to-any-file: - - third_party/packages/cupertino_icons/**/* + - third_party/packages/cupertino_icons/**/* 'p: dynamic_layouts': - - changed-files: - - any-glob-to-any-file: - - packages/dynamic_layouts/**/* + - packages/dynamic_layouts/**/* 'p: espresso': - - changed-files: - - any-glob-to-any-file: - - packages/espresso/**/* + - packages/espresso/**/* 'p: extension_google_sign_in_as_googleapis_auth': - - changed-files: - - any-glob-to-any-file: - - packages/extension_google_sign_in_as_googleapis_auth/**/* + - packages/extension_google_sign_in_as_googleapis_auth/**/* 'p: file_selector': - - changed-files: - - any-glob-to-any-file: - - packages/file_selector/**/* + - packages/file_selector/**/* 'p: flutter_adaptive_scaffold': - - changed-files: - - any-glob-to-any-file: - - packages/flutter_adaptive_scaffold/**/* + - packages/flutter_adaptive_scaffold/**/* 'p: flutter_image': - - changed-files: - - any-glob-to-any-file: - - packages/flutter_image/**/* + - packages/flutter_image/**/* 'p: flutter_lints': - - changed-files: - - any-glob-to-any-file: - - packages/flutter_lints/**/* + - packages/flutter_lints/**/* 'p: flutter_markdown': - - changed-files: - - any-glob-to-any-file: - - packages/flutter_markdown/**/* + - packages/flutter_markdown/**/* 'p: flutter_migrate': - - changed-files: - - any-glob-to-any-file: - - packages/flutter_migrate/**/* + - packages/flutter_migrate/**/* 'p: flutter_plugin_android_lifecycle': - - changed-files: - - any-glob-to-any-file: - - packages/flutter_plugin_android_lifecycle/**/* + - packages/flutter_plugin_android_lifecycle/**/* 'p: flutter_template_images': - - changed-files: - - any-glob-to-any-file: - - packages/flutter_template_images/**/* + - packages/flutter_template_images/**/* 'p: go_router': - - changed-files: - - any-glob-to-any-file: - - packages/go_router/**/* + - packages/go_router/**/* 'p: go_router_builder': - - changed-files: - - any-glob-to-any-file: - - packages/go_router_builder/**/* + - packages/go_router_builder/**/* 'p: google_identity_services': - - changed-files: - - any-glob-to-any-file: - - packages/google_indentity_services_web/** + - packages/google_indentity_services_web/** 'p: google_maps_flutter': - - changed-files: - - any-glob-to-any-file: - - packages/google_maps_flutter/**/* + - packages/google_maps_flutter/**/* 'p: google_sign_in': - - changed-files: - - any-glob-to-any-file: - - packages/google_sign_in/**/* + - packages/google_sign_in/**/* 'p: image_picker': - - changed-files: - - any-glob-to-any-file: - - packages/image_picker/**/* + - packages/image_picker/**/* 'p: in_app_purchase': - - changed-files: - - any-glob-to-any-file: - - packages/in_app_purchase/**/* + - packages/in_app_purchase/**/* 'p: ios_platform_images': - - changed-files: - - any-glob-to-any-file: - - packages/ios_platform_images/**/* + - packages/ios_platform_images/**/* 'p: local_auth': - - changed-files: - - any-glob-to-any-file: - - packages/local_auth/**/* + - packages/local_auth/**/* 'p: metrics_center': - - changed-files: - - any-glob-to-any-file: - - packages/metrics_center/**/* + - packages/metrics_center/**/* 'p: multicast_dns': - - changed-files: - - any-glob-to-any-file: - - packages/multicast_dns/**/* + - packages/multicast_dns/**/* 'p: palette_generator': - - changed-files: - - any-glob-to-any-file: - - packages/palette_generator/**/* + - packages/palette_generator/**/* 'p: path_provider': - - changed-files: - - any-glob-to-any-file: - - packages/path_provider/**/* + - packages/path_provider/**/* 'p: pigeon': - - changed-files: - - any-glob-to-any-file: - - packages/pigeon/**/* + - packages/pigeon/**/* 'p: plugin_platform_interface': - - changed-files: - - any-glob-to-any-file: - - packages/plugin_platform_interface/**/* + - packages/plugin_platform_interface/**/* 'p: pointer_interceptor': - - changed-files: - - any-glob-to-any-file: - - packages/pointer_interceptor/**/* + - packages/pointer_interceptor/**/* 'p: quick_actions': - - changed-files: - - any-glob-to-any-file: - - packages/quick_actions/**/* + - packages/quick_actions/**/* 'p: rfw': - - changed-files: - - any-glob-to-any-file: - - packages/rfw/**/* + - packages/rfw/**/* 'p: shared_preferences': - - changed-files: - - any-glob-to-any-file: - - packages/shared_preferences/**/* + - packages/shared_preferences/**/* 'p: standard_message_codec': - - changed-files: - - any-glob-to-any-file: - - packages/standard_message_codec/**/* + - packages/standard_message_codec/**/* 'p: url_launcher': - - changed-files: - - any-glob-to-any-file: - - packages/url_launcher/**/* + - packages/url_launcher/**/* 'p: video_player': - - changed-files: - - any-glob-to-any-file: - - packages/video_player/**/* + - packages/video_player/**/* 'p: web_benchmarks': - - changed-files: - - any-glob-to-any-file: - - packages/web_benchmarks/**/* + - packages/web_benchmarks/**/* 'p: webview_flutter': - - changed-files: - - any-glob-to-any-file: - - packages/webview_flutter/**/* + - packages/webview_flutter/**/* 'p: xdg_directories': - - changed-files: - - any-glob-to-any-file: - - packages/xdg_directories/**/* + - packages/xdg_directories/**/* 'platform-android': - - changed-files: - - any-glob-to-any-file: - - packages/*/*_android/**/* - - packages/**/android/**/* + - packages/*/*_android/**/* + - packages/**/android/**/* 'platform-ios': - - changed-files: - - any-glob-to-any-file: - - packages/*/*_ios/**/* - - packages/*/*_storekit/**/* - - packages/*/*_wkwebview/**/* - - packages/**/ios/**/* + - packages/*/*_ios/**/* + - packages/*/*_storekit/**/* + - packages/*/*_wkwebview/**/* + - packages/**/ios/**/* 'platform-linux': - - changed-files: - - any-glob-to-any-file: - - packages/*/*_linux/**/* - - packages/**/linux/**/* + - packages/*/*_linux/**/* + - packages/**/linux/**/* 'platform-macos': - - changed-files: - - any-glob-to-any-file: - - packages/*/*_macos/**/* - - packages/**/macos/**/* + - packages/*/*_macos/**/* + - packages/**/macos/**/* 'platform-web': - - changed-files: - - any-glob-to-any-file: - - packages/*/*_web/**/* - - packages/**/web/**/* + - packages/*/*_web/**/* + - packages/**/web/**/* 'platform-windows': - - changed-files: - - any-glob-to-any-file: - - packages/*/*_windows/**/* - - packages/**/windows/**/* + - packages/*/*_windows/**/* + - packages/**/windows/**/* diff --git a/.github/workflows/pull_request_label.yml b/.github/workflows/pull_request_label.yml index da211b0e0dc1..ddcf40008c3c 100644 --- a/.github/workflows/pull_request_label.yml +++ b/.github/workflows/pull_request_label.yml @@ -21,7 +21,7 @@ jobs: pull-requests: write runs-on: ubuntu-latest steps: - - uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 + - uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" sync-labels: true diff --git a/.github/workflows/scorecards-analysis.yml b/.github/workflows/scorecards-analysis.yml index a43216837bb9..607b0c999cbb 100644 --- a/.github/workflows/scorecards-analysis.yml +++ b/.github/workflows/scorecards-analysis.yml @@ -49,6 +49,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: "Upload to code-scanning" - uses: github/codeql-action/upload-sarif@b374143c1149a9115d881581d29b8390bbcbb59c # v1.0.26 + uses: github/codeql-action/upload-sarif@74483a38d39275f33fcff5f35b679b5ca4a26a99 # v1.0.26 with: sarif_file: results.sarif diff --git a/CODEOWNERS b/CODEOWNERS index 16c60820938c..f7e8e1166455 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -71,17 +71,17 @@ packages/video_player/video_player_android/** @camsim99 # - iOS packages/camera/camera_avfoundation/** @hellohuanlin -packages/file_selector/file_selector_ios/** @jmagman +packages/file_selector/file_selector_ios/** @stuartmorgan packages/google_maps_flutter/google_maps_flutter_ios/** @hellohuanlin packages/google_sign_in/google_sign_in_ios/** @vashworth packages/image_picker/image_picker_ios/** @vashworth packages/in_app_purchase/in_app_purchase_storekit/** @louisehsu -packages/ios_platform_images/ios/** @jmagman +packages/ios_platform_images/ios/** @stuartmorgan packages/local_auth/local_auth_ios/** @louisehsu -packages/path_provider/path_provider_foundation/** @jmagman +packages/path_provider/path_provider_foundation/** @stuartmorgan packages/quick_actions/quick_actions_ios/** @hellohuanlin packages/shared_preferences/shared_preferences_foundation/** @tarrinneal -packages/url_launcher/url_launcher_ios/** @jmagman +packages/url_launcher/url_launcher_ios/** @stuartmorgan packages/video_player/video_player_avfoundation/** @hellohuanlin packages/webview_flutter/webview_flutter_wkwebview/** @hellohuanlin diff --git a/packages/animations/CHANGELOG.md b/packages/animations/CHANGELOG.md index 9b6c068a75bc..208823ee1626 100644 --- a/packages/animations/CHANGELOG.md +++ b/packages/animations/CHANGELOG.md @@ -1,11 +1,6 @@ -## 2.0.10 +## NEXT -* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. - -## 2.0.9 - -* Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. -* Migrate motion curves to use `Easing` class. +* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 2.0.8 @@ -33,7 +28,7 @@ * Updates for non-nullable bindings. ## 2.0.2 -* Fixed documentation for `OpenContainer` class; replaced `openBuilder` with `closedBuilder`. +* Fixed documentation for `OpenContainer` class; replaced `openBuilder` with `closedBuilder`. ## 2.0.1 * Add links to the spec and codelab. diff --git a/packages/animations/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/animations/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/animations/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/animations/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/animations/lib/src/fade_scale_transition.dart b/packages/animations/lib/src/fade_scale_transition.dart index 44487e042605..a9108e03b757 100644 --- a/packages/animations/lib/src/fade_scale_transition.dart +++ b/packages/animations/lib/src/fade_scale_transition.dart @@ -134,7 +134,7 @@ class FadeScaleTransition extends StatelessWidget { static final Animatable _scaleInTransition = Tween( begin: 0.80, end: 1.00, - ).chain(CurveTween(curve: Easing.legacyDecelerate)); + ).chain(CurveTween(curve: decelerateEasing)); static final Animatable _fadeOutTransition = Tween( begin: 1.0, end: 0.0, diff --git a/packages/animations/lib/src/shared_axis_transition.dart b/packages/animations/lib/src/shared_axis_transition.dart index 3b3340c9871e..9868e008cfc8 100644 --- a/packages/animations/lib/src/shared_axis_transition.dart +++ b/packages/animations/lib/src/shared_axis_transition.dart @@ -303,18 +303,18 @@ class _EnterTransition extends StatelessWidget { final bool reverse; static final Animatable _fadeInTransition = CurveTween( - curve: Easing.legacyDecelerate, + curve: decelerateEasing, ).chain(CurveTween(curve: const Interval(0.3, 1.0))); static final Animatable _scaleDownTransition = Tween( begin: 1.10, end: 1.00, - ).chain(CurveTween(curve: Easing.legacy)); + ).chain(CurveTween(curve: standardEasing)); static final Animatable _scaleUpTransition = Tween( begin: 0.80, end: 1.00, - ).chain(CurveTween(curve: Easing.legacy)); + ).chain(CurveTween(curve: standardEasing)); @override Widget build(BuildContext context) { @@ -323,7 +323,7 @@ class _EnterTransition extends StatelessWidget { final Animatable slideInTransition = Tween( begin: Offset(!reverse ? 30.0 : -30.0, 0.0), end: Offset.zero, - ).chain(CurveTween(curve: Easing.legacy)); + ).chain(CurveTween(curve: standardEasing)); return FadeTransition( opacity: _fadeInTransition.animate(animation), @@ -342,7 +342,7 @@ class _EnterTransition extends StatelessWidget { final Animatable slideInTransition = Tween( begin: Offset(0.0, !reverse ? 30.0 : -30.0), end: Offset.zero, - ).chain(CurveTween(curve: Easing.legacy)); + ).chain(CurveTween(curve: standardEasing)); return FadeTransition( opacity: _fadeInTransition.animate(animation), @@ -386,18 +386,18 @@ class _ExitTransition extends StatelessWidget { final Widget? child; static final Animatable _fadeOutTransition = _FlippedCurveTween( - curve: Easing.legacyAccelerate, + curve: accelerateEasing, ).chain(CurveTween(curve: const Interval(0.0, 0.3))); static final Animatable _scaleUpTransition = Tween( begin: 1.00, end: 1.10, - ).chain(CurveTween(curve: Easing.legacy)); + ).chain(CurveTween(curve: standardEasing)); static final Animatable _scaleDownTransition = Tween( begin: 1.00, end: 0.80, - ).chain(CurveTween(curve: Easing.legacy)); + ).chain(CurveTween(curve: standardEasing)); @override Widget build(BuildContext context) { @@ -406,7 +406,7 @@ class _ExitTransition extends StatelessWidget { final Animatable slideOutTransition = Tween( begin: Offset.zero, end: Offset(!reverse ? -30.0 : 30.0, 0.0), - ).chain(CurveTween(curve: Easing.legacy)); + ).chain(CurveTween(curve: standardEasing)); return FadeTransition( opacity: _fadeOutTransition.animate(animation), @@ -428,7 +428,7 @@ class _ExitTransition extends StatelessWidget { final Animatable slideOutTransition = Tween( begin: Offset.zero, end: Offset(0.0, !reverse ? -30.0 : 30.0), - ).chain(CurveTween(curve: Easing.legacy)); + ).chain(CurveTween(curve: standardEasing)); return FadeTransition( opacity: _fadeOutTransition.animate(animation), diff --git a/packages/animations/pubspec.yaml b/packages/animations/pubspec.yaml index 2a18abddc48f..461fe2538041 100644 --- a/packages/animations/pubspec.yaml +++ b/packages/animations/pubspec.yaml @@ -2,11 +2,11 @@ name: animations description: Fancy pre-built animations that can easily be integrated into any Flutter application. repository: https://github.com/flutter/packages/tree/main/packages/animations issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+animations%22 -version: 2.0.10 +version: 2.0.8 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" dependencies: flutter: diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 4c53fe61f071..b8a108b188b6 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,11 +1,6 @@ -## 0.10.5+7 - -* Updates example app to use non-deprecated video_player method. - -## 0.10.5+6 +## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Drop unused dependency on `package:quiver`. ## 0.10.5+5 diff --git a/packages/camera/camera/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/camera/camera/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/camera/camera/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/camera/camera/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/camera/camera/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/camera/camera/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/camera/camera/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/camera/camera/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/camera/camera/example/integration_test/camera_test.dart b/packages/camera/camera/example/integration_test/camera_test.dart index 1985d1793c66..6bef30e62c2a 100644 --- a/packages/camera/camera/example/integration_test/camera_test.dart +++ b/packages/camera/camera/example/integration_test/camera_test.dart @@ -69,28 +69,32 @@ void main() { expectedSize, Size(image.height.toDouble(), image.width.toDouble())); } - testWidgets('Capture specific image resolutions', - (WidgetTester tester) async { - final List cameras = await availableCameras(); - if (cameras.isEmpty) { - return; - } - for (final CameraDescription cameraDescription in cameras) { - bool previousPresetExactlySupported = true; - for (final MapEntry preset - in presetExpectedSizes.entries) { - final CameraController controller = - CameraController(cameraDescription, preset.key); - await controller.initialize(); - final bool presetExactlySupported = - await testCaptureImageResolution(controller, preset.key); - assert(!(!previousPresetExactlySupported && presetExactlySupported), - 'The camera took higher resolution pictures at a lower resolution.'); - previousPresetExactlySupported = presetExactlySupported; - await controller.dispose(); + testWidgets( + 'Capture specific image resolutions', + (WidgetTester tester) async { + final List cameras = await availableCameras(); + if (cameras.isEmpty) { + return; } - } - }); + for (final CameraDescription cameraDescription in cameras) { + bool previousPresetExactlySupported = true; + for (final MapEntry preset + in presetExpectedSizes.entries) { + final CameraController controller = + CameraController(cameraDescription, preset.key); + await controller.initialize(); + final bool presetExactlySupported = + await testCaptureImageResolution(controller, preset.key); + assert(!(!previousPresetExactlySupported && presetExactlySupported), + 'The camera took higher resolution pictures at a lower resolution.'); + previousPresetExactlySupported = presetExactlySupported; + await controller.dispose(); + } + } + }, + // TODO(egarciad): Fix https://github.com/flutter/flutter/issues/93686. + skip: true, + ); // This tests that the capture is no bigger than the preset, since we have // automatic code to fall back to smaller sizes when we need to. Returns diff --git a/packages/camera/camera/example/lib/main.dart b/packages/camera/camera/example/lib/main.dart index 481774cae277..c187e72aad99 100644 --- a/packages/camera/camera/example/lib/main.dart +++ b/packages/camera/camera/example/lib/main.dart @@ -986,7 +986,11 @@ class _CameraExampleHomeState extends State } final VideoPlayerController vController = kIsWeb - ? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path)) + // TODO(gabrielokura): remove the ignore once the following line can migrate to + // use VideoPlayerController.networkUrl after the issue is resolved. + // https://github.com/flutter/flutter/issues/121927 + // ignore: deprecated_member_use + ? VideoPlayerController.network(videoFile!.path) : VideoPlayerController.file(File(videoFile!.path)); videoPlayerListener = () { diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index fbfc6949e9f0..cf3560f2409b 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: flutter: sdk: flutter path_provider: ^2.0.0 - video_player: ^2.7.0 + video_player: ^2.1.4 dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 14e3aa48a0e5..1cbced739ffe 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing Dart. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.10.5+7 +version: 0.10.5+5 environment: sdk: ">=3.0.0 <4.0.0" @@ -28,12 +28,14 @@ dependencies: flutter: sdk: flutter flutter_plugin_android_lifecycle: ^2.0.2 + quiver: ^3.0.0 dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 plugin_platform_interface: ^2.0.0 + video_player: ^2.0.0 topics: - camera diff --git a/packages/camera/camera_android/CHANGELOG.md b/packages/camera/camera_android/CHANGELOG.md index 0bf174e781db..f070dc7e1573 100644 --- a/packages/camera/camera_android/CHANGELOG.md +++ b/packages/camera/camera_android/CHANGELOG.md @@ -1,11 +1,5 @@ -## 0.10.8+15 +## NEXT -* Updates example app to use non-deprecated video_player method. - -## 0.10.8+14 - -* Fixes `pausePreview` null pointer error. `pausePreview` should not be called - when camera is closed or not configured. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 0.10.8+13 diff --git a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java index 13dd0d74b122..5e526975172e 100644 --- a/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java +++ b/packages/camera/camera_android/android/src/main/java/io/flutter/plugins/camera/Camera.java @@ -1076,13 +1076,8 @@ public void unlockCaptureOrientation() { /** Pause the preview from dart. */ public void pausePreview() throws CameraAccessException { - if (!this.pausedPreview) { - this.pausedPreview = true; - - if (this.captureSession != null) { - this.captureSession.stopRepeating(); - } - } + this.pausedPreview = true; + this.captureSession.stopRepeating(); } /** Resume the preview from dart. */ diff --git a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraTest.java b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraTest.java index 7fdfa24d99fe..db05691ada49 100644 --- a/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraTest.java +++ b/packages/camera/camera_android/android/src/test/java/io/flutter/plugins/camera/CameraTest.java @@ -1165,19 +1165,6 @@ public void close_doesNotCloseCaptureSessionWhenCameraDeviceNonNull() { verify(mockCaptureSession, never()).close(); } - @Test - public void pausePreview_doesNotCallStopRepeatingWhenCameraClosed() throws CameraAccessException { - ArrayList mockRequestBuilders = new ArrayList<>(); - mockRequestBuilders.add(mock(CaptureRequest.Builder.class)); - CameraDeviceWrapper fakeCamera = new FakeCameraDeviceWrapper(mockRequestBuilders); - TestUtils.setPrivateField(camera, "cameraDevice", fakeCamera); - - camera.close(); - camera.pausePreview(); - - verify(mockCaptureSession, never()).stopRepeating(); - } - private static class TestCameraFeatureFactory implements CameraFeatureFactory { private final AutoFocusFeature mockAutoFocusFeature; private final ExposureLockFeature mockExposureLockFeature; diff --git a/packages/camera/camera_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/camera/camera_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/camera/camera_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/camera/camera_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/camera/camera_android/example/integration_test/camera_test.dart b/packages/camera/camera_android/example/integration_test/camera_test.dart index 1390de6c6da4..8d663074df72 100644 --- a/packages/camera/camera_android/example/integration_test/camera_test.dart +++ b/packages/camera/camera_android/example/integration_test/camera_test.dart @@ -70,29 +70,33 @@ void main() { expectedSize, Size(image.height.toDouble(), image.width.toDouble())); } - testWidgets('Capture specific image resolutions', - (WidgetTester tester) async { - final List cameras = - await CameraPlatform.instance.availableCameras(); - if (cameras.isEmpty) { - return; - } - for (final CameraDescription cameraDescription in cameras) { - bool previousPresetExactlySupported = true; - for (final MapEntry preset - in presetExpectedSizes.entries) { - final CameraController controller = - CameraController(cameraDescription, preset.key); - await controller.initialize(); - final bool presetExactlySupported = - await testCaptureImageResolution(controller, preset.key); - assert(!(!previousPresetExactlySupported && presetExactlySupported), - 'The camera took higher resolution pictures at a lower resolution.'); - previousPresetExactlySupported = presetExactlySupported; - await controller.dispose(); + testWidgets( + 'Capture specific image resolutions', + (WidgetTester tester) async { + final List cameras = + await CameraPlatform.instance.availableCameras(); + if (cameras.isEmpty) { + return; } - } - }); + for (final CameraDescription cameraDescription in cameras) { + bool previousPresetExactlySupported = true; + for (final MapEntry preset + in presetExpectedSizes.entries) { + final CameraController controller = + CameraController(cameraDescription, preset.key); + await controller.initialize(); + final bool presetExactlySupported = + await testCaptureImageResolution(controller, preset.key); + assert(!(!previousPresetExactlySupported && presetExactlySupported), + 'The camera took higher resolution pictures at a lower resolution.'); + previousPresetExactlySupported = presetExactlySupported; + await controller.dispose(); + } + } + }, + // TODO(egarciad): Fix https://github.com/flutter/flutter/issues/93686. + skip: true, + ); // This tests that the capture is no bigger than the preset, since we have // automatic code to fall back to smaller sizes when we need to. Returns diff --git a/packages/camera/camera_android/example/lib/main.dart b/packages/camera/camera_android/example/lib/main.dart index be43ba998ed4..ed1528b41698 100644 --- a/packages/camera/camera_android/example/lib/main.dart +++ b/packages/camera/camera_android/example/lib/main.dart @@ -994,7 +994,11 @@ class _CameraExampleHomeState extends State } final VideoPlayerController vController = kIsWeb - ? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path)) + // TODO(gabrielokura): remove the ignore once the following line can migrate to + // use VideoPlayerController.networkUrl after the issue is resolved. + // https://github.com/flutter/flutter/issues/121927 + // ignore: deprecated_member_use + ? VideoPlayerController.network(videoFile!.path) : VideoPlayerController.file(File(videoFile!.path)); videoPlayerListener = () { diff --git a/packages/camera/camera_android/example/pubspec.yaml b/packages/camera/camera_android/example/pubspec.yaml index 51be7296139f..f921c680dc55 100644 --- a/packages/camera/camera_android/example/pubspec.yaml +++ b/packages/camera/camera_android/example/pubspec.yaml @@ -18,7 +18,8 @@ dependencies: flutter: sdk: flutter path_provider: ^2.0.0 - video_player: ^2.7.0 + quiver: ^3.0.0 + video_player: ^2.1.4 dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/camera/camera_android/pubspec.yaml b/packages/camera/camera_android/pubspec.yaml index 570d7597fe91..021e8facd8cd 100644 --- a/packages/camera/camera_android/pubspec.yaml +++ b/packages/camera/camera_android/pubspec.yaml @@ -3,7 +3,7 @@ description: Android implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.10.8+15 +version: 0.10.8+13 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/camera/camera_android/test/android_camera_test.dart b/packages/camera/camera_android/test/android_camera_test.dart index 9cddd414b7bd..fb6f6a71639a 100644 --- a/packages/camera/camera_android/test/android_camera_test.dart +++ b/packages/camera/camera_android/test/android_camera_test.dart @@ -30,7 +30,7 @@ void main() { // Setting up a handler requires bindings to be initialized, and since // registerWith is called very early in initialization the bindings won't - // have been initialized. While registerWith could initialize them, that + // have been initialized. While registerWith could intialize them, that // could slow down startup, so instead the handler should be set up lazily. final ByteData? response = await TestDefaultBinaryMessengerBinding .instance.defaultBinaryMessenger diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index e7d7bfd4ea4b..579e29dea377 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,11 +1,6 @@ -## 0.5.0+24 - -* Updates example app to use non-deprecated video_player method. - -## 0.5.0+23 +## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Adds `CameraXProxy` class to test `JavaObject` creation and their method calls in the plugin. ## 0.5.0+22 diff --git a/packages/camera/camera_android_camerax/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/camera/camera_android_camerax/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/camera/camera_android_camerax/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/camera/camera_android_camerax/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/camera/camera_android_camerax/example/lib/main.dart b/packages/camera/camera_android_camerax/example/lib/main.dart index 449899aef7ed..a4434e7d5a9c 100644 --- a/packages/camera/camera_android_camerax/example/lib/main.dart +++ b/packages/camera/camera_android_camerax/example/lib/main.dart @@ -971,7 +971,11 @@ class _CameraExampleHomeState extends State } final VideoPlayerController vController = kIsWeb - ? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path)) + // TODO(gabrielokura): remove the ignore once the following line can migrate to + // use VideoPlayerController.networkUrl after the issue is resolved. + // https://github.com/flutter/flutter/issues/121927 + // ignore: deprecated_member_use + ? VideoPlayerController.network(videoFile!.path) : VideoPlayerController.file(File(videoFile!.path)); videoPlayerListener = () { diff --git a/packages/camera/camera_android_camerax/example/pubspec.yaml b/packages/camera/camera_android_camerax/example/pubspec.yaml index bdb8f516770e..7b0fadffbede 100644 --- a/packages/camera/camera_android_camerax/example/pubspec.yaml +++ b/packages/camera/camera_android_camerax/example/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: camera_platform_interface: ^2.2.0 flutter: sdk: flutter - video_player: ^2.7.0 + video_player: ^2.4.10 dev_dependencies: espresso: ^0.2.0 diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index b7f8f8a091d2..044778fc20f2 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -16,7 +16,6 @@ import 'camera_info.dart'; import 'camera_selector.dart'; import 'camera_state.dart'; import 'camerax_library.g.dart'; -import 'camerax_proxy.dart'; import 'exposure_state.dart'; import 'fallback_strategy.dart'; import 'image_analysis.dart'; @@ -42,18 +41,22 @@ import 'zoom_state.dart'; /// The Android implementation of [CameraPlatform] that uses the CameraX library. class AndroidCameraCameraX extends CameraPlatform { /// Constructs an [AndroidCameraCameraX]. - AndroidCameraCameraX(); + AndroidCameraCameraX() : _shouldCreateDetachedObjectForTesting = false; + + /// Constructs an [AndroidCameraCameraX] that is able to set + /// [_shouldCreateDetachedObjectForTesting] to create detached objects + /// for testing purposes only. + @visibleForTesting + AndroidCameraCameraX.forTesting( + {bool shouldCreateDetachedObjectForTesting = false}) + : _shouldCreateDetachedObjectForTesting = + shouldCreateDetachedObjectForTesting; /// Registers this class as the default instance of [CameraPlatform]. static void registerWith() { CameraPlatform.instance = AndroidCameraCameraX(); } - /// Proxy for creating `JavaObject`s and calling their methods that require - /// testing. - @visibleForTesting - CameraXProxy proxy = CameraXProxy(); - /// The [ProcessCameraProvider] instance used to access camera functionality. @visibleForTesting ProcessCameraProvider? processCameraProvider; @@ -137,6 +140,10 @@ class AndroidCameraCameraX extends CameraPlatform { cameraEventStreamController.stream .where((CameraEvent event) => event.cameraId == cameraId); + /// Conditional used to create detached objects for testing their + /// callback methods. + final bool _shouldCreateDetachedObjectForTesting; + /// The controller we need to stream image data. @visibleForTesting StreamController? cameraImageDataStreamController; @@ -160,7 +167,7 @@ class AndroidCameraCameraX extends CameraPlatform { Future> availableCameras() async { final List cameraDescriptions = []; - processCameraProvider ??= await proxy.getProcessCameraProvider(); + processCameraProvider ??= await ProcessCameraProvider.getInstance(); final List cameraInfos = await processCameraProvider!.getAvailableCameraInfos(); @@ -172,13 +179,11 @@ class AndroidCameraCameraX extends CameraPlatform { for (final CameraInfo cameraInfo in cameraInfos) { // Determine the lens direction by filtering the CameraInfo // TODO(gmackall): replace this with call to CameraInfo.getLensFacing when changes containing that method are available - if ((await proxy - .createCameraSelector(CameraSelector.lensFacingBack) + if ((await createCameraSelector(CameraSelector.lensFacingBack) .filter([cameraInfo])) .isNotEmpty) { cameraLensDirection = CameraLensDirection.back; - } else if ((await proxy - .createCameraSelector(CameraSelector.lensFacingFront) + } else if ((await createCameraSelector(CameraSelector.lensFacingFront) .filter([cameraInfo])) .isNotEmpty) { cameraLensDirection = CameraLensDirection.front; @@ -217,16 +222,16 @@ class AndroidCameraCameraX extends CameraPlatform { bool enableAudio = false, }) async { // Must obtain proper permissions before attempting to access a camera. - await proxy.requestCameraPermissions(enableAudio); + await requestCameraPermissions(enableAudio); // Save CameraSelector that matches cameraDescription. final int cameraSelectorLensDirection = _getCameraSelectorLensDirection(cameraDescription.lensDirection); final bool cameraIsFrontFacing = cameraSelectorLensDirection == CameraSelector.lensFacingFront; - cameraSelector = proxy.createCameraSelector(cameraSelectorLensDirection); + cameraSelector = createCameraSelector(cameraSelectorLensDirection); // Start listening for device orientation changes preceding camera creation. - proxy.startListeningForDeviceOrientationChange( + startListeningForDeviceOrientationChange( cameraIsFrontFacing, cameraDescription.sensorOrientation); // Determine ResolutionSelector and QualitySelector based on // resolutionPreset for camera UseCases. @@ -236,28 +241,27 @@ class AndroidCameraCameraX extends CameraPlatform { _getQualitySelectorFromPreset(resolutionPreset); // Retrieve a fresh ProcessCameraProvider instance. - processCameraProvider ??= await proxy.getProcessCameraProvider(); + processCameraProvider ??= await ProcessCameraProvider.getInstance(); processCameraProvider!.unbindAll(); // Configure Preview instance. final int targetRotation = _getTargetRotation(cameraDescription.sensorOrientation); - preview = proxy.createPreview( + preview = createPreview( targetRotation: targetRotation, resolutionSelector: presetResolutionSelector); - final int flutterSurfaceTextureId = - await proxy.setPreviewSurfaceProvider(preview!); + final int flutterSurfaceTextureId = await preview!.setSurfaceProvider(); // Configure ImageCapture instance. - imageCapture = proxy.createImageCapture(presetResolutionSelector); + imageCapture = createImageCapture(presetResolutionSelector); // Configure ImageAnalysis instance. // Defaults to YUV_420_888 image format. - imageAnalysis = proxy.createImageAnalysis(presetResolutionSelector); + imageAnalysis = createImageAnalysis(presetResolutionSelector); // Configure VideoCapture and Recorder instances. - recorder = proxy.createRecorder(presetQualitySelector); - videoCapture = await proxy.createVideoCapture(recorder!); + recorder = createRecorder(presetQualitySelector); + videoCapture = await createVideoCapture(recorder!); // Bind configured UseCases to ProcessCameraProvider instance & mark Preview // instance as bound but not paused. Video capture is bound at first use @@ -438,7 +442,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// Set the zoom level for the selected camera. /// /// The supplied [zoom] value should be between the minimum and the maximum - /// supported zoom level returned by [getMinZoomLevel] and [getMaxZoomLevel]. + /// supported zoom level returned by `getMinZoomLevel` and `getMaxZoomLevel`. /// Throws a `CameraException` when an illegal zoom level is supplied. @override Future setZoomLevel(int cameraId, double zoom) async { @@ -681,8 +685,9 @@ class AndroidCameraCameraX extends CameraPlatform { await _updateCameraInfoAndLiveCameraState(cameraId); } - /// Configures the [imageAnalysis] instance for image streaming. - Future _configureImageAnalysis(int cameraId) async { + /// Configures the [imageAnalysis] instance for image streaming and binds it + /// to camera lifecycle controlled by the [processCameraProvider]. + Future _configureAndBindImageAnalysisToLifecycle(int cameraId) async { // Create Analyzer that can read image data for image streaming. final WeakReference weakThis = WeakReference(this); @@ -711,7 +716,13 @@ class AndroidCameraCameraX extends CameraPlatform { unawaited(imageProxy.close()); } - final Analyzer analyzer = proxy.createAnalyzer(analyze); + // shouldCreateDetachedObjectForTesting is used to create an Analyzer + // detached from the native sideonly to test the logic of the Analyzer + // instance that will be used for image streaming. + final Analyzer analyzer = _shouldCreateDetachedObjectForTesting + ? Analyzer.detached(analyze: analyze) + : Analyzer(analyze: analyze); + await imageAnalysis!.setAnalyzer(analyzer); } @@ -731,7 +742,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// The [onListen] callback for the stream controller used for image /// streaming. Future _onFrameStreamListen(int cameraId) async { - await _configureImageAnalysis(cameraId); + await _configureAndBindImageAnalysisToLifecycle(cameraId); } /// The [onCancel] callback for the stream controller used for image @@ -798,7 +809,12 @@ class AndroidCameraCameraX extends CameraPlatform { } } - return proxy.createCameraStateObserver(onChanged); + // shouldCreateDetachedObjectForTesting is used to create an Observer + // detached from the native side only to test the logic of the Analyzer + // instance that will be used for image streaming. + return _shouldCreateDetachedObjectForTesting + ? Observer.detached(onChanged: onChanged) + : Observer(onChanged: onChanged); } // Methods for mapping Flutter camera constants to CameraX constants: @@ -864,18 +880,30 @@ class AndroidCameraCameraX extends CameraPlatform { break; case ResolutionPreset.max: // Automatically set strategy to choose highest available. - resolutionStrategy = - proxy.createResolutionStrategy(highestAvailable: true); - return proxy.createResolutionSelector(resolutionStrategy); + if (_shouldCreateDetachedObjectForTesting) { + resolutionStrategy = + ResolutionStrategy.detachedHighestAvailableStrategy(); + return ResolutionSelector.detached( + resolutionStrategy: resolutionStrategy); + } + resolutionStrategy = ResolutionStrategy.highestAvailableStrategy(); + return ResolutionSelector(resolutionStrategy: resolutionStrategy); case null: // If no preset is specified, default to CameraX's default behavior // for each UseCase. return null; } - resolutionStrategy = proxy.createResolutionStrategy( - boundSize: boundSize, fallbackRule: fallbackRule); - return proxy.createResolutionSelector(resolutionStrategy); + if (_shouldCreateDetachedObjectForTesting) { + resolutionStrategy = ResolutionStrategy.detached( + boundSize: boundSize, fallbackRule: fallbackRule); + return ResolutionSelector.detached( + resolutionStrategy: resolutionStrategy); + } + + resolutionStrategy = + ResolutionStrategy(boundSize: boundSize, fallbackRule: fallbackRule); + return ResolutionSelector(resolutionStrategy: resolutionStrategy); } /// Returns the [QualitySelector] that maps to the specified resolution @@ -913,10 +941,84 @@ class AndroidCameraCameraX extends CameraPlatform { // is unavailable. const VideoResolutionFallbackRule fallbackRule = VideoResolutionFallbackRule.lowerQualityOrHigherThan; - final FallbackStrategy fallbackStrategy = proxy.createFallbackStrategy( - quality: videoQuality, fallbackRule: fallbackRule); + final FallbackStrategy fallbackStrategy = + _shouldCreateDetachedObjectForTesting + ? FallbackStrategy.detached( + quality: videoQuality, fallbackRule: fallbackRule) + : FallbackStrategy( + quality: videoQuality, fallbackRule: fallbackRule); + + return _shouldCreateDetachedObjectForTesting + ? QualitySelector.detached(qualityList: [ + VideoQualityData(quality: videoQuality) + ], fallbackStrategy: fallbackStrategy) + : QualitySelector.from( + quality: VideoQualityData(quality: videoQuality), + fallbackStrategy: fallbackStrategy); + } + + // Methods for calls that need to be tested: + + /// Requests camera permissions. + @visibleForTesting + Future requestCameraPermissions(bool enableAudio) async { + await SystemServices.requestCameraPermissions(enableAudio); + } - return proxy.createQualitySelector( - videoQuality: videoQuality, fallbackStrategy: fallbackStrategy); + /// Subscribes the plugin as a listener to changes in device orientation. + @visibleForTesting + void startListeningForDeviceOrientationChange( + bool cameraIsFrontFacing, int sensorOrientation) { + SystemServices.startListeningForDeviceOrientationChange( + cameraIsFrontFacing, sensorOrientation); + } + + /// Returns a [CameraSelector] based on the specified camera lens direction. + @visibleForTesting + CameraSelector createCameraSelector(int cameraSelectorLensDirection) { + switch (cameraSelectorLensDirection) { + case CameraSelector.lensFacingFront: + return CameraSelector.getDefaultFrontCamera(); + case CameraSelector.lensFacingBack: + return CameraSelector.getDefaultBackCamera(); + default: + return CameraSelector(lensFacing: cameraSelectorLensDirection); + } + } + + /// Returns a [Preview] configured with the specified target rotation and + /// specified [ResolutionSelector]. + @visibleForTesting + Preview createPreview( + {required int targetRotation, ResolutionSelector? resolutionSelector}) { + return Preview( + targetRotation: targetRotation, resolutionSelector: resolutionSelector); + } + + /// Returns an [ImageCapture] configured with specified flash mode and + /// the specified [ResolutionSelector]. + @visibleForTesting + ImageCapture createImageCapture(ResolutionSelector? resolutionSelector) { + return ImageCapture(resolutionSelector: resolutionSelector); + } + + /// Returns a [Recorder] for use in video capture configured with the + /// specified [QualitySelector]. + @visibleForTesting + Recorder createRecorder(QualitySelector? qualitySelector) { + return Recorder(qualitySelector: qualitySelector); + } + + /// Returns a [VideoCapture] associated with the provided [Recorder]. + @visibleForTesting + Future createVideoCapture(Recorder recorder) async { + return VideoCapture.withOutput(recorder); + } + + /// Returns an [ImageAnalysis] configured with the specified + /// [ResolutionSelector]. + @visibleForTesting + ImageAnalysis createImageAnalysis(ResolutionSelector? resolutionSelector) { + return ImageAnalysis(resolutionSelector: resolutionSelector); } } diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart b/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart deleted file mode 100644 index 133d84544d9b..000000000000 --- a/packages/camera/camera_android_camerax/lib/src/camerax_proxy.dart +++ /dev/null @@ -1,224 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:ui' show Size; - -import 'analyzer.dart'; -import 'camera_selector.dart'; -import 'camera_state.dart'; -import 'camerax_library.g.dart'; -import 'fallback_strategy.dart'; -import 'image_analysis.dart'; -import 'image_capture.dart'; -import 'image_proxy.dart'; -import 'observer.dart'; -import 'preview.dart'; -import 'process_camera_provider.dart'; -import 'quality_selector.dart'; -import 'recorder.dart'; -import 'resolution_selector.dart'; -import 'resolution_strategy.dart'; -import 'system_services.dart'; -import 'video_capture.dart'; - -/// Handles `JavaObject` creation and calling their methods that require -/// testing. -/// -/// By default, each function will create `JavaObject`s attached to an -/// `InstanceManager` and call through to the appropriate method. -class CameraXProxy { - /// Constructs a [CameraXProxy]. - CameraXProxy({ - this.getProcessCameraProvider = _getProcessCameraProvider, - this.createCameraSelector = _createAttachedCameraSelector, - this.createPreview = _createAttachedPreview, - this.createImageCapture = _createAttachedImageCapture, - this.createRecorder = _createAttachedRecorder, - this.createVideoCapture = _createAttachedVideoCapture, - this.createImageAnalysis = _createAttachedImageAnalysis, - this.createAnalyzer = _createAttachedAnalyzer, - this.createCameraStateObserver = _createAttachedCameraStateObserver, - this.createResolutionStrategy = _createAttachedResolutionStrategy, - this.createResolutionSelector = _createAttachedResolutionSelector, - this.createFallbackStrategy = _createAttachedFallbackStrategy, - this.createQualitySelector = _createAttachedQualitySelector, - this.requestCameraPermissions = _requestCameraPermissions, - this.startListeningForDeviceOrientationChange = - _startListeningForDeviceOrientationChange, - this.setPreviewSurfaceProvider = _setPreviewSurfaceProvider, - }); - - /// Returns a [ProcessCameraProvider] instance. - Future Function() getProcessCameraProvider; - - /// Returns a [CameraSelector] based on the specified camera lens direction. - CameraSelector Function(int cameraSelectorLensDirection) createCameraSelector; - - /// Returns a [Preview] configured with the specified target rotation and - /// specified [ResolutionSelector]. - Preview Function( - {required int targetRotation, - ResolutionSelector? resolutionSelector}) createPreview; - - /// Returns an [ImageCapture] configured with specified flash mode and - /// the specified [ResolutionSelector]. - ImageCapture Function(ResolutionSelector? resolutionSelector) - createImageCapture; - - /// Returns a [Recorder] for use in video capture configured with the - /// specified [QualitySelector]. - Recorder Function(QualitySelector? qualitySelector) createRecorder; - - /// Returns a [VideoCapture] associated with the provided [Recorder]. - Future Function(Recorder recorder) createVideoCapture; - - /// Returns an [ImageAnalysis] configured with the specified - /// [ResolutionSelector]. - ImageAnalysis Function(ResolutionSelector? resolutionSelector) - createImageAnalysis; - - /// Returns an [Analyzer] configured with the specified callback for - /// analyzing [ImageProxy]s. - Analyzer Function(Future Function(ImageProxy imageProxy) analyze) - createAnalyzer; - - /// Returns an [Observer] of the [CameraState] with the specified callback - /// for handling changes in that state. - Observer Function(void Function(Object stateAsObject) onChanged) - createCameraStateObserver; - - /// Returns a [ResolutionStrategy] configured with the specified bounds for - /// choosing a resolution and a fallback rule if achieving a resolution within - /// those bounds is not possible. - /// - /// [highestAvailable] is used to specify whether or not the highest available - /// [ResolutionStrategy] should be returned. - ResolutionStrategy Function( - {bool highestAvailable, - Size? boundSize, - int? fallbackRule}) createResolutionStrategy; - - /// Returns a [ResolutionSelector] configured with the specified - /// [ResolutionStrategy]. - ResolutionSelector Function(ResolutionStrategy resolutionStrategy) - createResolutionSelector; - - /// Returns a [FallbackStrategy] configured with the specified [VideoQuality] - /// and [VideoResolutionFallbackRule]. - FallbackStrategy Function( - {required VideoQuality quality, - required VideoResolutionFallbackRule fallbackRule}) - createFallbackStrategy; - - /// Returns a [QualitySelector] configured with the specified [VideoQuality] - /// and [FallbackStrategy]. - QualitySelector Function( - {required VideoQuality videoQuality, - required FallbackStrategy fallbackStrategy}) createQualitySelector; - - /// Requests camera permissions. - Future Function(bool enableAudio) requestCameraPermissions; - - /// Subscribes the plugin as a listener to changes in device orientation. - void Function(bool cameraIsFrontFacing, int sensorOrientation) - startListeningForDeviceOrientationChange; - - /// Sets the surface provider of the specified [Preview] instance and returns - /// the ID corresponding to the surface it will provide. - Future Function(Preview preview) setPreviewSurfaceProvider; - - static Future _getProcessCameraProvider() { - return ProcessCameraProvider.getInstance(); - } - - static CameraSelector _createAttachedCameraSelector( - int cameraSelectorLensDirection) { - switch (cameraSelectorLensDirection) { - case CameraSelector.lensFacingFront: - return CameraSelector.getDefaultFrontCamera(); - case CameraSelector.lensFacingBack: - return CameraSelector.getDefaultBackCamera(); - default: - return CameraSelector(lensFacing: cameraSelectorLensDirection); - } - } - - static Preview _createAttachedPreview( - {required int targetRotation, ResolutionSelector? resolutionSelector}) { - return Preview( - targetRotation: targetRotation, resolutionSelector: resolutionSelector); - } - - static ImageCapture _createAttachedImageCapture( - ResolutionSelector? resolutionSelector) { - return ImageCapture(resolutionSelector: resolutionSelector); - } - - static Recorder _createAttachedRecorder(QualitySelector? qualitySelector) { - return Recorder(qualitySelector: qualitySelector); - } - - static Future _createAttachedVideoCapture( - Recorder recorder) async { - return VideoCapture.withOutput(recorder); - } - - static ImageAnalysis _createAttachedImageAnalysis( - ResolutionSelector? resolutionSelector) { - return ImageAnalysis(resolutionSelector: resolutionSelector); - } - - static Analyzer _createAttachedAnalyzer( - Future Function(ImageProxy imageProxy) analyze) { - return Analyzer(analyze: analyze); - } - - static Observer _createAttachedCameraStateObserver( - void Function(Object stateAsObject) onChanged) { - return Observer(onChanged: onChanged); - } - - static ResolutionStrategy _createAttachedResolutionStrategy( - {bool highestAvailable = false, Size? boundSize, int? fallbackRule}) { - if (highestAvailable) { - return ResolutionStrategy.highestAvailableStrategy(); - } - - return ResolutionStrategy( - boundSize: boundSize!, fallbackRule: fallbackRule); - } - - static ResolutionSelector _createAttachedResolutionSelector( - ResolutionStrategy resolutionStrategy) { - return ResolutionSelector(resolutionStrategy: resolutionStrategy); - } - - static FallbackStrategy _createAttachedFallbackStrategy( - {required VideoQuality quality, - required VideoResolutionFallbackRule fallbackRule}) { - return FallbackStrategy(quality: quality, fallbackRule: fallbackRule); - } - - static QualitySelector _createAttachedQualitySelector( - {required VideoQuality videoQuality, - required FallbackStrategy fallbackStrategy}) { - return QualitySelector.from( - quality: VideoQualityData(quality: videoQuality), - fallbackStrategy: fallbackStrategy); - } - - static Future _requestCameraPermissions(bool enableAudio) async { - await SystemServices.requestCameraPermissions(enableAudio); - } - - static void _startListeningForDeviceOrientationChange( - bool cameraIsFrontFacing, int sensorOrientation) { - SystemServices.startListeningForDeviceOrientationChange( - cameraIsFrontFacing, sensorOrientation); - } - - static Future _setPreviewSurfaceProvider(Preview preview) async { - return preview.setSurfaceProvider(); - } -} diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index 2cf3ac3b5d11..dd05e33eaf74 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android_camerax description: Android implementation of the camera plugin using the CameraX library. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.5.0+24 +version: 0.5.0+22 environment: sdk: ">=3.0.0 <4.0.0" @@ -31,7 +31,7 @@ dev_dependencies: build_runner: ^2.2.0 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^9.1.0 topics: diff --git a/packages/camera/camera_android_camerax/test/analyzer_test.mocks.dart b/packages/camera/camera_android_camerax/test/analyzer_test.mocks.dart index 106c8376f915..0100036f79ef 100644 --- a/packages/camera/camera_android_camerax/test/analyzer_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/analyzer_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/analyzer_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index 100d3040eb9b..1b2b7c50a84f 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -14,7 +14,6 @@ import 'package:camera_android_camerax/src/camera_selector.dart'; import 'package:camera_android_camerax/src/camera_state.dart'; import 'package:camera_android_camerax/src/camera_state_error.dart'; import 'package:camera_android_camerax/src/camerax_library.g.dart'; -import 'package:camera_android_camerax/src/camerax_proxy.dart'; import 'package:camera_android_camerax/src/exposure_state.dart'; import 'package:camera_android_camerax/src/fallback_strategy.dart'; import 'package:camera_android_camerax/src/image_analysis.dart'; @@ -46,26 +45,20 @@ import 'android_camera_camerax_test.mocks.dart'; import 'test_camerax_library.g.dart'; @GenerateNiceMocks(>[ - MockSpec(), MockSpec(), MockSpec(), MockSpec(), MockSpec(), MockSpec(), MockSpec(), - MockSpec(), MockSpec(), MockSpec(), MockSpec(), - MockSpec>(), - MockSpec(), MockSpec(), MockSpec(), MockSpec(), - MockSpec(), MockSpec(), - MockSpec(), - MockSpec(), + MockSpec(), MockSpec(), MockSpec(), MockSpec(), @@ -114,7 +107,8 @@ void main() { test('Should fetch CameraDescription instances for available cameras', () async { // Arrange - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = FakeAndroidCameraCameraX(); + camera.processCameraProvider = MockProcessCameraProvider(); final List returnData = [ { 'name': 'Camera 0', @@ -129,38 +123,23 @@ void main() { ]; // Create mocks to use - final MockProcessCameraProvider mockProcessCameraProvider = - MockProcessCameraProvider(); - final MockCameraSelector mockFrontCameraSelector = MockCameraSelector(); - final MockCameraSelector mockBackCameraSelector = MockCameraSelector(); final MockCameraInfo mockFrontCameraInfo = MockCameraInfo(); final MockCameraInfo mockBackCameraInfo = MockCameraInfo(); - // Tell plugin to create mock CameraSelectors for testing. - camera.proxy = CameraXProxy( - getProcessCameraProvider: () => - Future.value(mockProcessCameraProvider), - createCameraSelector: (int cameraSelectorLensDirection) { - switch (cameraSelectorLensDirection) { - case CameraSelector.lensFacingFront: - return mockFrontCameraSelector; - case CameraSelector.lensFacingBack: - default: - return mockBackCameraSelector; - } - }, - ); - // Mock calls to native platform - when(mockProcessCameraProvider.getAvailableCameraInfos()).thenAnswer( + when(camera.processCameraProvider!.getAvailableCameraInfos()).thenAnswer( (_) async => [mockBackCameraInfo, mockFrontCameraInfo]); - when(mockBackCameraSelector.filter([mockFrontCameraInfo])) + when(camera.mockBackCameraSelector + .filter([mockFrontCameraInfo])) .thenAnswer((_) async => []); - when(mockBackCameraSelector.filter([mockBackCameraInfo])) + when(camera.mockBackCameraSelector + .filter([mockBackCameraInfo])) .thenAnswer((_) async => [mockBackCameraInfo]); - when(mockFrontCameraSelector.filter([mockBackCameraInfo])) + when(camera.mockFrontCameraSelector + .filter([mockBackCameraInfo])) .thenAnswer((_) async => []); - when(mockFrontCameraSelector.filter([mockFrontCameraInfo])) + when(camera.mockFrontCameraSelector + .filter([mockFrontCameraInfo])) .thenAnswer((_) async => [mockFrontCameraInfo]); when(mockBackCameraInfo.getSensorRotationDegrees()) .thenAnswer((_) async => 0); @@ -188,7 +167,10 @@ void main() { test( 'createCamera requests permissions, starts listening for device orientation changes, updates camera state observers, and returns flutter surface texture ID', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); + final MockProcessCameraProvider mockProcessCameraProvider = + MockProcessCameraProvider(); const CameraLensDirection testLensDirection = CameraLensDirection.back; const int testSensorOrientation = 90; const CameraDescription testCameraDescription = CameraDescription( @@ -198,75 +180,18 @@ void main() { const ResolutionPreset testResolutionPreset = ResolutionPreset.veryHigh; const bool enableAudio = true; const int testSurfaceTextureId = 6; - - // Mock/Detached objects for (typically attached) objects created by - // createCamera. - final MockProcessCameraProvider mockProcessCameraProvider = - MockProcessCameraProvider(); - final MockPreview mockPreview = MockPreview(); - final MockCameraSelector mockBackCameraSelector = MockCameraSelector(); - final MockImageCapture mockImageCapture = MockImageCapture(); - final MockImageAnalysis mockImageAnalysis = MockImageAnalysis(); - final MockRecorder mockRecorder = MockRecorder(); - final MockVideoCapture mockVideoCapture = MockVideoCapture(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); final MockLiveCameraState mockLiveCameraState = MockLiveCameraState(); - bool cameraPermissionsRequested = false; - bool startedListeningForDeviceOrientationChanges = false; - - // Tell plugin to create mock/detached objects and stub method calls for the - // testing of createCamera. - camera.proxy = CameraXProxy( - getProcessCameraProvider: () => - Future.value(mockProcessCameraProvider), - createCameraSelector: (int cameraSelectorLensDirection) { - switch (cameraSelectorLensDirection) { - case CameraSelector.lensFacingFront: - return MockCameraSelector(); - case CameraSelector.lensFacingBack: - default: - return mockBackCameraSelector; - } - }, - createPreview: ( - {required int targetRotation, - ResolutionSelector? resolutionSelector}) => - mockPreview, - createImageCapture: (_) => mockImageCapture, - createRecorder: (_) => mockRecorder, - createVideoCapture: (_) => Future.value(mockVideoCapture), - createImageAnalysis: (_) => mockImageAnalysis, - createResolutionStrategy: ( - {bool highestAvailable = false, - Size? boundSize, - int? fallbackRule}) => - MockResolutionStrategy(), - createResolutionSelector: (_) => MockResolutionSelector(), - createFallbackStrategy: ( - {required VideoQuality quality, - required VideoResolutionFallbackRule fallbackRule}) => - MockFallbackStrategy(), - createQualitySelector: ( - {required VideoQuality videoQuality, - required FallbackStrategy fallbackStrategy}) => - MockQualitySelector(), - createCameraStateObserver: (void Function(Object) onChanged) => - Observer.detached(onChanged: onChanged), - requestCameraPermissions: (_) { - cameraPermissionsRequested = true; - return Future.value(); - }, - startListeningForDeviceOrientationChange: (_, __) { - startedListeningForDeviceOrientationChanges = true; - }, - ); - when(mockPreview.setSurfaceProvider()) + when(camera.testPreview.setSurfaceProvider()) .thenAnswer((_) async => testSurfaceTextureId); - when(mockProcessCameraProvider.bindToLifecycle(mockBackCameraSelector, - [mockPreview, mockImageCapture, mockImageAnalysis])) - .thenAnswer((_) async => mockCamera); + when(mockProcessCameraProvider.bindToLifecycle( + camera.mockBackCameraSelector, [ + camera.testPreview, + camera.testImageCapture, + camera.testImageAnalysis + ])).thenAnswer((_) async => mockCamera); when(mockCamera.getCameraInfo()).thenAnswer((_) async => mockCameraInfo); when(mockCameraInfo.getCameraState()) .thenAnswer((_) async => mockLiveCameraState); @@ -278,21 +203,21 @@ void main() { equals(testSurfaceTextureId)); // Verify permissions are requested and the camera starts listening for device orientation changes. - expect(cameraPermissionsRequested, isTrue); - expect(startedListeningForDeviceOrientationChanges, isTrue); + expect(camera.cameraPermissionsRequested, isTrue); + expect(camera.startedListeningForDeviceOrientationChanges, isTrue); // Verify CameraSelector is set with appropriate lens direction. - expect(camera.cameraSelector, equals(mockBackCameraSelector)); + expect(camera.cameraSelector, equals(camera.mockBackCameraSelector)); // Verify the camera's Preview instance is instantiated properly. - expect(camera.preview, equals(mockPreview)); + expect(camera.preview, equals(camera.testPreview)); // Verify the camera's ImageCapture instance is instantiated properly. - expect(camera.imageCapture, equals(mockImageCapture)); + expect(camera.imageCapture, equals(camera.testImageCapture)); // Verify the camera's Recorder and VideoCapture instances are instantiated properly. - expect(camera.recorder, equals(mockRecorder)); - expect(camera.videoCapture, equals(mockVideoCapture)); + expect(camera.recorder, equals(camera.testRecorder)); + expect(camera.videoCapture, equals(camera.testVideoCapture)); // Verify the camera's Preview instance has its surface provider set. verify(camera.preview!.setSurfaceProvider()); @@ -310,7 +235,10 @@ void main() { test( 'createCamera binds Preview and ImageCapture use cases to ProcessCameraProvider instance', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); + final MockProcessCameraProvider mockProcessCameraProvider = + MockProcessCameraProvider(); const CameraLensDirection testLensDirection = CameraLensDirection.back; const int testSensorOrientation = 90; const CameraDescription testCameraDescription = CameraDescription( @@ -319,65 +247,17 @@ void main() { sensorOrientation: testSensorOrientation); const ResolutionPreset testResolutionPreset = ResolutionPreset.veryHigh; const bool enableAudio = true; - - // Mock/Detached objects for (typically attached) objects created by - // createCamera. - final MockProcessCameraProvider mockProcessCameraProvider = - MockProcessCameraProvider(); - final MockPreview mockPreview = MockPreview(); - final MockCameraSelector mockBackCameraSelector = MockCameraSelector(); - final MockImageCapture mockImageCapture = MockImageCapture(); - final MockImageAnalysis mockImageAnalysis = MockImageAnalysis(); - final MockRecorder mockRecorder = MockRecorder(); - final MockVideoCapture mockVideoCapture = MockVideoCapture(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); - // Tell plugin to create mock/detached objects and stub method calls for the - // testing of createCamera. - camera.proxy = CameraXProxy( - getProcessCameraProvider: () => - Future.value(mockProcessCameraProvider), - createCameraSelector: (int cameraSelectorLensDirection) { - switch (cameraSelectorLensDirection) { - case CameraSelector.lensFacingFront: - return MockCameraSelector(); - case CameraSelector.lensFacingBack: - default: - return mockBackCameraSelector; - } - }, - createPreview: ( - {required int targetRotation, - ResolutionSelector? resolutionSelector}) => - mockPreview, - createImageCapture: (_) => mockImageCapture, - createRecorder: (_) => mockRecorder, - createVideoCapture: (_) => Future.value(mockVideoCapture), - createImageAnalysis: (_) => mockImageAnalysis, - createResolutionStrategy: ( - {bool highestAvailable = false, - Size? boundSize, - int? fallbackRule}) => - MockResolutionStrategy(), - createResolutionSelector: (_) => MockResolutionSelector(), - createFallbackStrategy: ( - {required VideoQuality quality, - required VideoResolutionFallbackRule fallbackRule}) => - MockFallbackStrategy(), - createQualitySelector: ( - {required VideoQuality videoQuality, - required FallbackStrategy fallbackStrategy}) => - MockQualitySelector(), - createCameraStateObserver: (void Function(Object) onChanged) => - Observer.detached(onChanged: onChanged), - requestCameraPermissions: (_) => Future.value(), - startListeningForDeviceOrientationChange: (_, __) {}, - ); - - when(mockProcessCameraProvider.bindToLifecycle(mockBackCameraSelector, - [mockPreview, mockImageCapture, mockImageAnalysis])) - .thenAnswer((_) async => mockCamera); + camera.processCameraProvider = mockProcessCameraProvider; + + when(mockProcessCameraProvider.bindToLifecycle( + camera.mockBackCameraSelector, [ + camera.testPreview, + camera.testImageCapture, + camera.testImageAnalysis + ])).thenAnswer((_) async => mockCamera); when(mockCamera.getCameraInfo()).thenAnswer((_) async => mockCameraInfo); when(mockCameraInfo.getCameraState()) .thenAnswer((_) async => MockLiveCameraState()); @@ -387,8 +267,12 @@ void main() { enableAudio: enableAudio); // Verify expected UseCases were bound. - verify(camera.processCameraProvider!.bindToLifecycle(camera.cameraSelector!, - [mockPreview, mockImageCapture, mockImageAnalysis])); + verify(camera.processCameraProvider!.bindToLifecycle( + camera.cameraSelector!, [ + camera.testPreview, + camera.testImageCapture, + camera.testImageAnalysis + ])); // Verify the camera's CameraInfo instance got updated. expect(camera.cameraInfo, equals(mockCameraInfo)); @@ -397,7 +281,10 @@ void main() { test( 'createCamera properly sets preset resolution for non-video capture use cases', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); + final MockProcessCameraProvider mockProcessCameraProvider = + MockProcessCameraProvider(); const CameraLensDirection testLensDirection = CameraLensDirection.back; const int testSensorOrientation = 90; const CameraDescription testCameraDescription = CameraDescription( @@ -406,71 +293,16 @@ void main() { sensorOrientation: testSensorOrientation); const bool enableAudio = true; final MockCamera mockCamera = MockCamera(); - - // Mock/Detached objects for (typically attached) objects created by - // createCamera. - final MockProcessCameraProvider mockProcessCameraProvider = - MockProcessCameraProvider(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); - final MockCameraSelector mockBackCameraSelector = MockCameraSelector(); - final MockCameraSelector mockFrontCameraSelector = MockCameraSelector(); - final MockVideoCapture mockVideoCapture = MockVideoCapture(); - final MockRecorder mockRecorder = MockRecorder(); - - // Tell plugin to create mock/detached objects for testing createCamera - // as needed. - camera.proxy = CameraXProxy( - getProcessCameraProvider: () => - Future.value(mockProcessCameraProvider), - createCameraSelector: (int cameraSelectorLensDirection) { - switch (cameraSelectorLensDirection) { - case CameraSelector.lensFacingFront: - return mockFrontCameraSelector; - case CameraSelector.lensFacingBack: - default: - return mockBackCameraSelector; - } - }, - createPreview: ( - {required int targetRotation, - ResolutionSelector? resolutionSelector}) => - Preview.detached( - targetRotation: targetRotation, - resolutionSelector: resolutionSelector), - createImageCapture: (ResolutionSelector? resolutionSelector) => - ImageCapture.detached(resolutionSelector: resolutionSelector), - createRecorder: (_) => mockRecorder, - createVideoCapture: (_) => Future.value(mockVideoCapture), - createImageAnalysis: (ResolutionSelector? resolutionSelector) => - ImageAnalysis.detached(resolutionSelector: resolutionSelector), - createResolutionStrategy: ( - {bool highestAvailable = false, Size? boundSize, int? fallbackRule}) { - if (highestAvailable) { - return ResolutionStrategy.detachedHighestAvailableStrategy(); - } - - return ResolutionStrategy.detached( - boundSize: boundSize, fallbackRule: fallbackRule); - }, - createResolutionSelector: (ResolutionStrategy resolutionStrategy) => - ResolutionSelector.detached(resolutionStrategy: resolutionStrategy), - createFallbackStrategy: ( - {required VideoQuality quality, - required VideoResolutionFallbackRule fallbackRule}) => - MockFallbackStrategy(), - createQualitySelector: ( - {required VideoQuality videoQuality, - required FallbackStrategy fallbackStrategy}) => - MockQualitySelector(), - createCameraStateObserver: (_) => MockObserver(), - requestCameraPermissions: (_) => Future.value(), - startListeningForDeviceOrientationChange: (_, __) {}, - setPreviewSurfaceProvider: (_) => Future.value( - 3), // 3 is a random Flutter SurfaceTexture ID for testing}, - ); - - when(mockProcessCameraProvider.bindToLifecycle(mockBackCameraSelector, any)) - .thenAnswer((_) async => mockCamera); + + camera.processCameraProvider = mockProcessCameraProvider; + + when(mockProcessCameraProvider.bindToLifecycle( + camera.mockBackCameraSelector, [ + camera.testPreview, + camera.testImageCapture, + camera.testImageAnalysis + ])).thenAnswer((_) async => mockCamera); when(mockCamera.getCameraInfo()).thenAnswer((_) async => mockCameraInfo); when(mockCameraInfo.getCameraState()) .thenAnswer((_) async => MockLiveCameraState()); @@ -545,7 +377,10 @@ void main() { test( 'createCamera properly sets preset resolution for video capture use case', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); + final MockProcessCameraProvider mockProcessCameraProvider = + MockProcessCameraProvider(); const CameraLensDirection testLensDirection = CameraLensDirection.back; const int testSensorOrientation = 90; const CameraDescription testCameraDescription = CameraDescription( @@ -554,71 +389,20 @@ void main() { sensorOrientation: testSensorOrientation); const bool enableAudio = true; final MockCamera mockCamera = MockCamera(); - - // Mock/Detached objects for (typically attached) objects created by - // createCamera. - final MockProcessCameraProvider mockProcessCameraProvider = - MockProcessCameraProvider(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); - final MockCameraSelector mockBackCameraSelector = MockCameraSelector(); - final MockCameraSelector mockFrontCameraSelector = MockCameraSelector(); - final MockPreview mockPreview = MockPreview(); - final MockImageCapture mockImageCapture = MockImageCapture(); - final MockVideoCapture mockVideoCapture = MockVideoCapture(); - final MockImageAnalysis mockImageAnalysis = MockImageAnalysis(); - // Tell plugin to create mock/detached objects for testing createCamera - // as needed. - camera.proxy = CameraXProxy( - getProcessCameraProvider: () => - Future.value(mockProcessCameraProvider), - createCameraSelector: (int cameraSelectorLensDirection) { - switch (cameraSelectorLensDirection) { - case CameraSelector.lensFacingFront: - return mockFrontCameraSelector; - case CameraSelector.lensFacingBack: - default: - return mockBackCameraSelector; - } - }, - createPreview: ( - {required int targetRotation, - ResolutionSelector? resolutionSelector}) => - mockPreview, - createImageCapture: (_) => mockImageCapture, - createRecorder: (QualitySelector? qualitySelector) => - Recorder.detached(qualitySelector: qualitySelector), - createVideoCapture: (_) => Future.value(mockVideoCapture), - createImageAnalysis: (_) => mockImageAnalysis, - createResolutionStrategy: ( - {bool highestAvailable = false, - Size? boundSize, - int? fallbackRule}) => - MockResolutionStrategy(), - createResolutionSelector: (_) => MockResolutionSelector(), - createFallbackStrategy: ( - {required VideoQuality quality, - required VideoResolutionFallbackRule fallbackRule}) => - FallbackStrategy.detached( - quality: quality, fallbackRule: fallbackRule), - createQualitySelector: ( - {required VideoQuality videoQuality, - required FallbackStrategy fallbackStrategy}) => - QualitySelector.detached(qualityList: [ - VideoQualityData(quality: videoQuality) - ], fallbackStrategy: fallbackStrategy), - createCameraStateObserver: (void Function(Object) onChanged) => - Observer.detached(onChanged: onChanged), - requestCameraPermissions: (_) => Future.value(), - startListeningForDeviceOrientationChange: (_, __) {}, - ); - - when(mockProcessCameraProvider.bindToLifecycle(mockBackCameraSelector, - [mockPreview, mockImageCapture, mockImageAnalysis])) - .thenAnswer((_) async => mockCamera); + camera.processCameraProvider = mockProcessCameraProvider; + + when(mockProcessCameraProvider.bindToLifecycle( + camera.mockBackCameraSelector, [ + camera.testPreview, + camera.testImageCapture, + camera.testImageAnalysis + ])).thenAnswer((_) async => mockCamera); when(mockCamera.getCameraInfo()).thenAnswer((_) async => mockCameraInfo); when(mockCameraInfo.getCameraState()) .thenAnswer((_) async => MockLiveCameraState()); + camera.processCameraProvider = mockProcessCameraProvider; // Test non-null resolution presets. for (final ResolutionPreset resolutionPreset in ResolutionPreset.values) { @@ -675,8 +459,10 @@ void main() { }); test('initializeCamera sends expected CameraInitializedEvent', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); - + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); + final MockProcessCameraProvider mockProcessCameraProvider = + MockProcessCameraProvider(); const int cameraId = 10; const CameraLensDirection testLensDirection = CameraLensDirection.back; const int testSensorOrientation = 90; @@ -691,58 +477,7 @@ void main() { final Camera mockCamera = MockCamera(); final ResolutionInfo testResolutionInfo = ResolutionInfo(width: resolutionWidth, height: resolutionHeight); - - // Mocks for (typically attached) objects created by createCamera. - final MockProcessCameraProvider mockProcessCameraProvider = - MockProcessCameraProvider(); final CameraInfo mockCameraInfo = MockCameraInfo(); - final MockCameraSelector mockBackCameraSelector = MockCameraSelector(); - final MockCameraSelector mockFrontCameraSelector = MockCameraSelector(); - final MockPreview mockPreview = MockPreview(); - final MockImageCapture mockImageCapture = MockImageCapture(); - final MockImageAnalysis mockImageAnalysis = MockImageAnalysis(); - - // Tell plugin to create mock/detached objects for testing createCamera - // as needed. - camera.proxy = CameraXProxy( - getProcessCameraProvider: () => - Future.value(mockProcessCameraProvider), - createCameraSelector: (int cameraSelectorLensDirection) { - switch (cameraSelectorLensDirection) { - case CameraSelector.lensFacingFront: - return mockFrontCameraSelector; - case CameraSelector.lensFacingBack: - default: - return mockBackCameraSelector; - } - }, - createPreview: ( - {required int targetRotation, - ResolutionSelector? resolutionSelector}) => - mockPreview, - createImageCapture: (_) => mockImageCapture, - createRecorder: (QualitySelector? qualitySelector) => MockRecorder(), - createVideoCapture: (_) => Future.value(MockVideoCapture()), - createImageAnalysis: (_) => mockImageAnalysis, - createResolutionStrategy: ( - {bool highestAvailable = false, - Size? boundSize, - int? fallbackRule}) => - MockResolutionStrategy(), - createResolutionSelector: (_) => MockResolutionSelector(), - createFallbackStrategy: ( - {required VideoQuality quality, - required VideoResolutionFallbackRule fallbackRule}) => - MockFallbackStrategy(), - createQualitySelector: ( - {required VideoQuality videoQuality, - required FallbackStrategy fallbackStrategy}) => - MockQualitySelector(), - createCameraStateObserver: (void Function(Object) onChanged) => - Observer.detached(onChanged: onChanged), - requestCameraPermissions: (_) => Future.value(), - startListeningForDeviceOrientationChange: (_, __) {}, - ); // TODO(camsim99): Modify this when camera configuration is supported and // default values no longer being used. @@ -758,16 +493,22 @@ void main() { FocusMode.auto, false); - // Call createCamera. - when(mockPreview.setSurfaceProvider()).thenAnswer((_) async => cameraId); + camera.processCameraProvider = mockProcessCameraProvider; - when(mockProcessCameraProvider.bindToLifecycle(mockBackCameraSelector, - [mockPreview, mockImageCapture, mockImageAnalysis])) - .thenAnswer((_) async => mockCamera); + // Call createCamera. + when(camera.testPreview.setSurfaceProvider()) + .thenAnswer((_) async => cameraId); + + when(camera.processCameraProvider!.bindToLifecycle( + camera.mockBackCameraSelector, [ + camera.testPreview, + camera.testImageCapture, + camera.testImageAnalysis + ])).thenAnswer((_) async => mockCamera); when(mockCamera.getCameraInfo()).thenAnswer((_) async => mockCameraInfo); when(mockCameraInfo.getCameraState()) .thenAnswer((_) async => MockLiveCameraState()); - when(mockPreview.getResolutionInfo()) + when(camera.testPreview.getResolutionInfo()) .thenAnswer((_) async => testResolutionInfo); await camera.createCamera(testCameraDescription, testResolutionPreset, @@ -881,7 +622,6 @@ void main() { () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); - // Set directly for test versus calling createCamera. camera.processCameraProvider = MockProcessCameraProvider(); camera.preview = MockPreview(); @@ -898,7 +638,6 @@ void main() { () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); - // Set directly for test versus calling createCamera. camera.processCameraProvider = MockProcessCameraProvider(); camera.preview = MockPreview(); @@ -918,7 +657,6 @@ void main() { final MockCameraInfo mockCameraInfo = MockCameraInfo(); final MockLiveCameraState mockLiveCameraState = MockLiveCameraState(); - // Set directly for test versus calling createCamera. camera.processCameraProvider = mockProcessCameraProvider; camera.cameraSelector = MockCameraSelector(); camera.preview = MockPreview(); @@ -944,26 +682,18 @@ void main() { test( 'resumePreview binds preview to lifecycle and updates camera state observers if not already bound', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final AndroidCameraCameraX camera = AndroidCameraCameraX.forTesting( + shouldCreateDetachedObjectForTesting: true); final MockProcessCameraProvider mockProcessCameraProvider = MockProcessCameraProvider(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); final MockLiveCameraState mockLiveCameraState = MockLiveCameraState(); - // Set directly for test versus calling createCamera. camera.processCameraProvider = mockProcessCameraProvider; camera.cameraSelector = MockCameraSelector(); camera.preview = MockPreview(); - // Tell plugin to create a detached Observer, that is created to - // track camera state once preview is bound to the lifecycle and needed to - // test for expected updates. - camera.proxy = CameraXProxy( - createCameraStateObserver: - (void Function(Object stateAsObject) onChanged) => - Observer.detached(onChanged: onChanged)); - when(mockProcessCameraProvider .bindToLifecycle(camera.cameraSelector, [camera.preview!])) .thenAnswer((_) async => mockCamera); @@ -988,23 +718,18 @@ void main() { test( 'buildPreview returns a FutureBuilder that does not return a Texture until the preview is bound to the lifecycle', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final AndroidCameraCameraX camera = AndroidCameraCameraX.forTesting( + shouldCreateDetachedObjectForTesting: true); final MockProcessCameraProvider mockProcessCameraProvider = MockProcessCameraProvider(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); const int textureId = 75; - // Set directly for test versus calling createCamera. camera.processCameraProvider = mockProcessCameraProvider; camera.cameraSelector = MockCameraSelector(); camera.preview = MockPreview(); - // Tell plugin to create a mock Observer, that is created to - // track camera state once preview is bound to the lifecycle. - camera.proxy = - CameraXProxy(createCameraStateObserver: (_) => MockObserver()); - when(mockProcessCameraProvider .bindToLifecycle(camera.cameraSelector, [camera.preview!])) .thenAnswer((_) async => mockCamera); @@ -1032,23 +757,18 @@ void main() { test( 'buildPreview returns a FutureBuilder that returns a Texture once the preview is bound to the lifecycle', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final AndroidCameraCameraX camera = AndroidCameraCameraX.forTesting( + shouldCreateDetachedObjectForTesting: true); final MockProcessCameraProvider mockProcessCameraProvider = MockProcessCameraProvider(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); const int textureId = 75; - // Set directly for test versus calling createCamera. camera.processCameraProvider = mockProcessCameraProvider; camera.cameraSelector = MockCameraSelector(); camera.preview = MockPreview(); - // Tell plugin to create a mock Observer, that is created to - // track camera state once preview is bound to the lifecycle. - camera.proxy = - CameraXProxy(createCameraStateObserver: (_) => MockObserver()); - when(mockProcessCameraProvider .bindToLifecycle(camera.cameraSelector, [camera.preview!])) .thenAnswer((_) async => mockCamera); @@ -1070,27 +790,25 @@ void main() { 'startVideoCapturing binds video capture use case and starts the recording', () async { // Set up mocks and constants. - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = FakeAndroidCameraCameraX(); + camera.processCameraProvider = MockProcessCameraProvider(); + camera.cameraSelector = MockCameraSelector(); + camera.recorder = camera.testRecorder; + camera.videoCapture = camera.testVideoCapture; + camera.camera = MockCamera(); final MockPendingRecording mockPendingRecording = MockPendingRecording(); final MockRecording mockRecording = MockRecording(); final TestSystemServicesHostApi mockSystemServicesApi = MockTestSystemServicesHostApi(); TestSystemServicesHostApi.setup(mockSystemServicesApi); - // Set directly for test versus calling createCamera. - camera.processCameraProvider = MockProcessCameraProvider(); - camera.camera = MockCamera(); - camera.recorder = MockRecorder(); - camera.videoCapture = MockVideoCapture(); - camera.cameraSelector = MockCameraSelector(); - const int cameraId = 17; const String outputPath = '/temp/MOV123.temp'; // Mock method calls. when(mockSystemServicesApi.getTempFilePath(camera.videoPrefix, '.temp')) .thenReturn(outputPath); - when(camera.recorder!.prepareRecording(outputPath)) + when(camera.testRecorder.prepareRecording(outputPath)) .thenAnswer((_) async => mockPendingRecording); when(mockPendingRecording.start()).thenAnswer((_) async => mockRecording); when(camera.processCameraProvider!.isBound(camera.videoCapture!)) @@ -1111,33 +829,32 @@ void main() { 'startVideoCapturing binds video capture use case and starts the recording' ' on first call, and does nothing on second call', () async { // Set up mocks and constants. - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = FakeAndroidCameraCameraX(); + camera.processCameraProvider = MockProcessCameraProvider(); + camera.cameraSelector = MockCameraSelector(); + camera.recorder = camera.testRecorder; + camera.videoCapture = camera.testVideoCapture; + camera.camera = MockCamera(); final MockPendingRecording mockPendingRecording = MockPendingRecording(); final MockRecording mockRecording = MockRecording(); final TestSystemServicesHostApi mockSystemServicesApi = MockTestSystemServicesHostApi(); TestSystemServicesHostApi.setup(mockSystemServicesApi); - // Set directly for test versus calling createCamera. - camera.processCameraProvider = MockProcessCameraProvider(); - camera.recorder = MockRecorder(); - camera.videoCapture = MockVideoCapture(); - camera.cameraSelector = MockCameraSelector(); - const int cameraId = 17; const String outputPath = '/temp/MOV123.temp'; // Mock method calls. when(mockSystemServicesApi.getTempFilePath(camera.videoPrefix, '.temp')) .thenReturn(outputPath); - when(camera.recorder!.prepareRecording(outputPath)) + when(camera.testRecorder.prepareRecording(outputPath)) .thenAnswer((_) async => mockPendingRecording); when(mockPendingRecording.start()).thenAnswer((_) async => mockRecording); when(camera.processCameraProvider!.isBound(camera.videoCapture!)) .thenAnswer((_) async => false); when(camera.processCameraProvider!.bindToLifecycle( camera.cameraSelector!, [camera.videoCapture!])) - .thenAnswer((_) async => MockCamera()); + .thenAnswer((_) async => camera.camera!); await camera.startVideoCapturing(const VideoCaptureOptions(cameraId)); @@ -1151,8 +868,8 @@ void main() { verify(mockSystemServicesApi.getTempFilePath(camera.videoPrefix, '.temp')) .called(1); verifyNoMoreInteractions(mockSystemServicesApi); - verify(camera.recorder!.prepareRecording(outputPath)).called(1); - verifyNoMoreInteractions(camera.recorder); + verify(camera.testRecorder.prepareRecording(outputPath)).called(1); + verifyNoMoreInteractions(camera.testRecorder); verify(mockPendingRecording.start()).called(1); verifyNoMoreInteractions(mockPendingRecording); }); @@ -1161,29 +878,21 @@ void main() { 'startVideoCapturing called with stream options starts image streaming', () async { // Set up mocks and constants. - final AndroidCameraCameraX camera = AndroidCameraCameraX(); - - // Set directly for test versus calling createCamera. + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); final MockProcessCameraProvider mockProcessCameraProvider = MockProcessCameraProvider(); camera.processCameraProvider = mockProcessCameraProvider; camera.cameraSelector = MockCameraSelector(); - camera.videoCapture = MockVideoCapture(); - camera.imageAnalysis = MockImageAnalysis(); + camera.recorder = camera.testRecorder; + camera.videoCapture = camera.testVideoCapture; + camera.imageAnalysis = camera.testImageAnalysis; camera.camera = MockCamera(); - final Recorder mockRecorder = MockRecorder(); - camera.recorder = mockRecorder; final MockPendingRecording mockPendingRecording = MockPendingRecording(); final TestSystemServicesHostApi mockSystemServicesApi = MockTestSystemServicesHostApi(); TestSystemServicesHostApi.setup(mockSystemServicesApi); - // Tell plugin to create detached Analyzer for testing. - camera.proxy = CameraXProxy( - createAnalyzer: - (Future Function(ImageProxy imageProxy) analyze) => - Analyzer.detached(analyze: analyze)); - const int cameraId = 17; const String outputPath = '/temp/MOV123.temp'; final Completer imageDataCompleter = @@ -1198,7 +907,7 @@ void main() { .thenAnswer((_) async => true); when(mockSystemServicesApi.getTempFilePath(camera.videoPrefix, '.temp')) .thenReturn(outputPath); - when(camera.recorder!.prepareRecording(outputPath)) + when(camera.testRecorder.prepareRecording(outputPath)) .thenAnswer((_) async => mockPendingRecording); when(mockProcessCameraProvider.bindToLifecycle(any, any)) .thenAnswer((_) => Future.value(camera.camera)); @@ -1217,10 +926,7 @@ void main() { test('pauseVideoRecording pauses the recording', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); final MockRecording recording = MockRecording(); - - // Set directly for test versus calling startVideoCapturing. camera.recording = recording; - await camera.pauseVideoRecording(0); verify(recording.pause()); verifyNoMoreInteractions(recording); @@ -1229,10 +935,7 @@ void main() { test('resumeVideoRecording resumes the recording', () async { final AndroidCameraCameraX camera = AndroidCameraCameraX(); final MockRecording recording = MockRecording(); - - // Set directly for test versus calling startVideoCapturing. camera.recording = recording; - await camera.resumeVideoRecording(0); verify(recording.resume()); verifyNoMoreInteractions(recording); @@ -1246,7 +949,6 @@ void main() { final MockVideoCapture videoCapture = MockVideoCapture(); const String videoOutputPath = '/test/output/path'; - // Set directly for test versus calling createCamera and startVideoCapturing. camera.processCameraProvider = processCameraProvider; camera.recording = recording; camera.videoCapture = videoCapture; @@ -1265,7 +967,6 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const String videoOutputPath = '/test/output/path'; - // Set directly for test versus calling startVideoCapturing. camera.recording = null; camera.videoOutputPath = videoOutputPath; @@ -1279,7 +980,6 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); final MockRecording recording = MockRecording(); - // Set directly for test versus calling startVideoCapturing. camera.recording = recording; camera.videoOutputPath = null; @@ -1298,7 +998,6 @@ void main() { final MockVideoCapture videoCapture = MockVideoCapture(); const String videoOutputPath = '/test/output/path'; - // Set directly for test versus calling createCamera and startVideoCapturing. camera.processCameraProvider = processCameraProvider; camera.recording = recording; camera.videoCapture = videoCapture; @@ -1318,7 +1017,6 @@ void main() { final AndroidCameraCameraX camera = AndroidCameraCameraX(); const String testPicturePath = 'test/absolute/path/to/picture'; - // Set directly for test versus calling createCamera. camera.imageCapture = MockImageCapture(); when(camera.imageCapture!.takePicture()) @@ -1335,7 +1033,6 @@ void main() { const int cameraId = 77; final MockCameraControl mockCameraControl = MockCameraControl(); - // Set directly for test versus calling createCamera. camera.imageCapture = MockImageCapture(); camera.camera = MockCamera(); @@ -1354,7 +1051,6 @@ void main() { const int cameraId = 22; final MockCameraControl mockCameraControl = MockCameraControl(); - // Set directly for test versus calling createCamera. camera.imageCapture = MockImageCapture(); camera.camera = MockCamera(); @@ -1397,7 +1093,6 @@ void main() { const int cameraId = 44; final MockCameraControl mockCameraControl = MockCameraControl(); - // Set directly for test versus calling createCamera. camera.camera = MockCamera(); when(camera.camera!.getCameraControl()) @@ -1415,7 +1110,6 @@ void main() { const int cameraId = 33; final MockCameraControl mockCameraControl = MockCameraControl(); - // Set directly for test versus calling createCamera. camera.camera = MockCamera(); when(camera.camera!.getCameraControl()) @@ -1448,7 +1142,6 @@ void main() { ExposureCompensationRange(minCompensation: 3, maxCompensation: 4), exposureCompensationStep: 0.2); - // Set directly for test versus calling createCamera. camera.cameraInfo = mockCameraInfo; when(mockCameraInfo.getExposureState()) @@ -1467,7 +1160,6 @@ void main() { ExposureCompensationRange(minCompensation: 3, maxCompensation: 4), exposureCompensationStep: 0.2); - // Set directly for test versus calling createCamera. camera.cameraInfo = mockCameraInfo; when(mockCameraInfo.getExposureState()) @@ -1485,7 +1177,6 @@ void main() { ExposureCompensationRange(minCompensation: 3, maxCompensation: 4), exposureCompensationStep: 0.2); - // Set directly for test versus calling createCamera. camera.cameraInfo = mockCameraInfo; when(mockCameraInfo.getExposureState()) @@ -1502,7 +1193,6 @@ void main() { final ZoomState zoomState = ZoomState.detached(maxZoomRatio: maxZoomRatio, minZoomRatio: 0); - // Set directly for test versus calling createCamera. camera.cameraInfo = mockCameraInfo; when(mockCameraInfo.getZoomState()) @@ -1520,7 +1210,6 @@ void main() { final ZoomState zoomState = ZoomState.detached(maxZoomRatio: 1, minZoomRatio: minZoomRatio); - // Set directly for test versus calling createCamera. camera.cameraInfo = mockCameraInfo; when(mockCameraInfo.getZoomState()) @@ -1536,7 +1225,6 @@ void main() { const double zoomRatio = 0.3; final MockCameraControl mockCameraControl = MockCameraControl(); - // Set directly for test versus calling createCamera. camera.camera = MockCamera(); when(camera.camera!.getCameraControl()) @@ -1550,20 +1238,14 @@ void main() { test( 'onStreamedFrameAvailable emits CameraImageData when picked up from CameraImageData stream controller', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); final MockProcessCameraProvider mockProcessCameraProvider = MockProcessCameraProvider(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); const int cameraId = 22; - // Tell plugin to create detached Analyzer for testing. - camera.proxy = CameraXProxy( - createAnalyzer: - (Future Function(ImageProxy imageProxy) analyze) => - Analyzer.detached(analyze: analyze)); - - // Set directly for test versus calling createCamera. camera.processCameraProvider = mockProcessCameraProvider; camera.cameraSelector = MockCameraSelector(); camera.imageAnalysis = MockImageAnalysis(); @@ -1590,20 +1272,14 @@ void main() { test( 'onStreamedFrameAvailable emits CameraImageData when listened to after cancelation', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); final MockProcessCameraProvider mockProcessCameraProvider = MockProcessCameraProvider(); final MockCamera mockCamera = MockCamera(); final MockCameraInfo mockCameraInfo = MockCameraInfo(); const int cameraId = 22; - // Tell plugin to create detached Analyzer for testing. - camera.proxy = CameraXProxy( - createAnalyzer: - (Future Function(ImageProxy imageProxy) analyze) => - Analyzer.detached(analyze: analyze)); - - // Set directly for test versus calling createCamera. camera.processCameraProvider = mockProcessCameraProvider; camera.cameraSelector = MockCameraSelector(); camera.imageAnalysis = MockImageAnalysis(); @@ -1640,7 +1316,8 @@ void main() { test( 'onStreamedFrameAvailable returns stream that responds expectedly to being listened to', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); const int cameraId = 33; final ProcessCameraProvider mockProcessCameraProvider = MockProcessCameraProvider(); @@ -1658,13 +1335,6 @@ void main() { const int imageHeight = 100; const int imageWidth = 200; - // Tell plugin to create detached Analyzer for testing. - camera.proxy = CameraXProxy( - createAnalyzer: - (Future Function(ImageProxy imageProxy) analyze) => - Analyzer.detached(analyze: analyze)); - - // Set directly for test versus calling createCamera. camera.processCameraProvider = mockProcessCameraProvider; camera.cameraSelector = mockCameraSelector; camera.imageAnalysis = mockImageAnalysis; @@ -1718,11 +1388,16 @@ void main() { test( 'onStreamedFrameAvailable returns stream that responds expectedly to being canceled', () async { - final AndroidCameraCameraX camera = AndroidCameraCameraX(); + final FakeAndroidCameraCameraX camera = + FakeAndroidCameraCameraX(shouldCreateDetachedObjectForTesting: true); const int cameraId = 32; + final ProcessCameraProvider mockProcessCameraProvider = + MockProcessCameraProvider(); + final CameraSelector mockCameraSelector = MockCameraSelector(); final MockImageAnalysis mockImageAnalysis = MockImageAnalysis(); - // Set directly for test versus calling createCamera. + camera.processCameraProvider = mockProcessCameraProvider; + camera.cameraSelector = mockCameraSelector; camera.imageAnalysis = mockImageAnalysis; final StreamSubscription imageStreamSubscription = camera @@ -1734,3 +1409,74 @@ void main() { verify(mockImageAnalysis.clearAnalyzer()); }); } + +/// Fake [AndroidCameraCameraX] that stubs behavior of some methods for testing. +class FakeAndroidCameraCameraX extends AndroidCameraCameraX { + FakeAndroidCameraCameraX({super.shouldCreateDetachedObjectForTesting}) + : super.forTesting(); + + bool cameraPermissionsRequested = false; + bool startedListeningForDeviceOrientationChanges = false; + + // Mocks available for use throughout testing. + final MockPreview testPreview = MockPreview(); + final MockImageCapture testImageCapture = MockImageCapture(); + final MockCameraSelector mockBackCameraSelector = MockCameraSelector(); + final MockCameraSelector mockFrontCameraSelector = MockCameraSelector(); + final MockRecorder testRecorder = MockRecorder(); + final MockVideoCapture testVideoCapture = MockVideoCapture(); + final MockImageAnalysis testImageAnalysis = MockImageAnalysis(); + + @override + Future requestCameraPermissions(bool enableAudio) async { + cameraPermissionsRequested = true; + } + + @override + void startListeningForDeviceOrientationChange( + bool cameraIsFrontFacing, int sensorOrientation) { + startedListeningForDeviceOrientationChanges = true; + return; + } + + @override + CameraSelector createCameraSelector(int cameraSelectorLensDirection) { + switch (cameraSelectorLensDirection) { + case CameraSelector.lensFacingFront: + return mockFrontCameraSelector; + case CameraSelector.lensFacingBack: + default: + return mockBackCameraSelector; + } + } + + @override + Preview createPreview( + {required int targetRotation, ResolutionSelector? resolutionSelector}) { + when(testPreview.resolutionSelector).thenReturn(resolutionSelector); + return testPreview; + } + + @override + ImageCapture createImageCapture(ResolutionSelector? resolutionSelector) { + when(testImageCapture.resolutionSelector).thenReturn(resolutionSelector); + return testImageCapture; + } + + @override + Recorder createRecorder(QualitySelector? qualitySelector) { + when(testRecorder.qualitySelector).thenReturn(qualitySelector); + return testRecorder; + } + + @override + Future createVideoCapture(Recorder recorder) { + return Future.value(testVideoCapture); + } + + @override + ImageAnalysis createImageAnalysis(ResolutionSelector? resolutionSelector) { + when(testImageAnalysis.resolutionSelector).thenReturn(resolutionSelector); + return testImageAnalysis; + } +} diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart index 6dfdd2b4824c..4fae31e06390 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.mocks.dart @@ -1,54 +1,49 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/android_camera_camerax_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i16; -import 'dart:typed_data' as _i27; +import 'dart:async' as _i15; +import 'dart:typed_data' as _i24; -import 'package:camera_android_camerax/src/analyzer.dart' as _i15; -import 'package:camera_android_camerax/src/camera.dart' as _i9; +import 'package:camera_android_camerax/src/analyzer.dart' as _i20; +import 'package:camera_android_camerax/src/camera.dart' as _i8; import 'package:camera_android_camerax/src/camera_control.dart' as _i3; import 'package:camera_android_camerax/src/camera_info.dart' as _i2; -import 'package:camera_android_camerax/src/camera_selector.dart' as _i20; -import 'package:camera_android_camerax/src/camera_state.dart' as _i18; +import 'package:camera_android_camerax/src/camera_selector.dart' as _i18; +import 'package:camera_android_camerax/src/camera_state.dart' as _i16; import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i7; import 'package:camera_android_camerax/src/exposure_state.dart' as _i5; -import 'package:camera_android_camerax/src/fallback_strategy.dart' as _i21; -import 'package:camera_android_camerax/src/image_analysis.dart' as _i22; -import 'package:camera_android_camerax/src/image_capture.dart' as _i23; -import 'package:camera_android_camerax/src/image_proxy.dart' as _i17; +import 'package:camera_android_camerax/src/image_analysis.dart' as _i19; +import 'package:camera_android_camerax/src/image_capture.dart' as _i21; +import 'package:camera_android_camerax/src/image_proxy.dart' as _i22; import 'package:camera_android_camerax/src/live_data.dart' as _i4; -import 'package:camera_android_camerax/src/observer.dart' as _i26; -import 'package:camera_android_camerax/src/pending_recording.dart' as _i10; -import 'package:camera_android_camerax/src/plane_proxy.dart' as _i25; -import 'package:camera_android_camerax/src/preview.dart' as _i28; +import 'package:camera_android_camerax/src/observer.dart' as _i30; +import 'package:camera_android_camerax/src/pending_recording.dart' as _i9; +import 'package:camera_android_camerax/src/plane_proxy.dart' as _i23; +import 'package:camera_android_camerax/src/preview.dart' as _i25; import 'package:camera_android_camerax/src/process_camera_provider.dart' - as _i29; -import 'package:camera_android_camerax/src/quality_selector.dart' as _i31; + as _i26; import 'package:camera_android_camerax/src/recorder.dart' as _i11; -import 'package:camera_android_camerax/src/recording.dart' as _i8; -import 'package:camera_android_camerax/src/resolution_selector.dart' as _i32; -import 'package:camera_android_camerax/src/resolution_strategy.dart' as _i33; -import 'package:camera_android_camerax/src/use_case.dart' as _i30; -import 'package:camera_android_camerax/src/video_capture.dart' as _i34; -import 'package:camera_android_camerax/src/zoom_state.dart' as _i19; +import 'package:camera_android_camerax/src/recording.dart' as _i10; +import 'package:camera_android_camerax/src/use_case.dart' as _i27; +import 'package:camera_android_camerax/src/video_capture.dart' as _i28; +import 'package:camera_android_camerax/src/zoom_state.dart' as _i17; import 'package:camera_platform_interface/camera_platform_interface.dart' as _i6; import 'package:flutter/foundation.dart' as _i14; import 'package:flutter/services.dart' as _i13; import 'package:flutter/widgets.dart' as _i12; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i24; -import 'test_camerax_library.g.dart' as _i35; +import 'test_camerax_library.g.dart' as _i29; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -119,8 +114,9 @@ class _FakeExposureCompensationRange_5 extends _i1.SmartFake ); } -class _FakeRecording_6 extends _i1.SmartFake implements _i8.Recording { - _FakeRecording_6( +class _FakeResolutionInfo_6 extends _i1.SmartFake + implements _i7.ResolutionInfo { + _FakeResolutionInfo_6( Object parent, Invocation parentInvocation, ) : super( @@ -129,9 +125,8 @@ class _FakeRecording_6 extends _i1.SmartFake implements _i8.Recording { ); } -class _FakeResolutionInfo_7 extends _i1.SmartFake - implements _i7.ResolutionInfo { - _FakeResolutionInfo_7( +class _FakeCamera_7 extends _i1.SmartFake implements _i8.Camera { + _FakeCamera_7( Object parent, Invocation parentInvocation, ) : super( @@ -140,8 +135,9 @@ class _FakeResolutionInfo_7 extends _i1.SmartFake ); } -class _FakeCamera_8 extends _i1.SmartFake implements _i9.Camera { - _FakeCamera_8( +class _FakePendingRecording_8 extends _i1.SmartFake + implements _i9.PendingRecording { + _FakePendingRecording_8( Object parent, Invocation parentInvocation, ) : super( @@ -150,9 +146,8 @@ class _FakeCamera_8 extends _i1.SmartFake implements _i9.Camera { ); } -class _FakePendingRecording_9 extends _i1.SmartFake - implements _i10.PendingRecording { - _FakePendingRecording_9( +class _FakeRecording_9 extends _i1.SmartFake implements _i10.Recording { + _FakeRecording_9( Object parent, Invocation parentInvocation, ) : super( @@ -220,33 +215,18 @@ class _FakeDiagnosticsNode_13 extends _i1.SmartFake super.toString(); } -/// A class which mocks [Analyzer]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockAnalyzer extends _i1.Mock implements _i15.Analyzer { - @override - _i16.Future Function(_i17.ImageProxy) get analyze => - (super.noSuchMethod( - Invocation.getter(#analyze), - returnValue: (_i17.ImageProxy imageProxy) => _i16.Future.value(), - returnValueForMissingStub: (_i17.ImageProxy imageProxy) => - _i16.Future.value(), - ) as _i16.Future Function(_i17.ImageProxy)); -} - /// A class which mocks [Camera]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockCamera extends _i1.Mock implements _i9.Camera { +class MockCamera extends _i1.Mock implements _i8.Camera { @override - _i16.Future<_i2.CameraInfo> getCameraInfo() => (super.noSuchMethod( + _i15.Future<_i2.CameraInfo> getCameraInfo() => (super.noSuchMethod( Invocation.method( #getCameraInfo, [], ), - returnValue: _i16.Future<_i2.CameraInfo>.value(_FakeCameraInfo_0( + returnValue: _i15.Future<_i2.CameraInfo>.value(_FakeCameraInfo_0( this, Invocation.method( #getCameraInfo, @@ -254,22 +234,21 @@ class MockCamera extends _i1.Mock implements _i9.Camera { ), )), returnValueForMissingStub: - _i16.Future<_i2.CameraInfo>.value(_FakeCameraInfo_0( + _i15.Future<_i2.CameraInfo>.value(_FakeCameraInfo_0( this, Invocation.method( #getCameraInfo, [], ), )), - ) as _i16.Future<_i2.CameraInfo>); - + ) as _i15.Future<_i2.CameraInfo>); @override - _i16.Future<_i3.CameraControl> getCameraControl() => (super.noSuchMethod( + _i15.Future<_i3.CameraControl> getCameraControl() => (super.noSuchMethod( Invocation.method( #getCameraControl, [], ), - returnValue: _i16.Future<_i3.CameraControl>.value(_FakeCameraControl_1( + returnValue: _i15.Future<_i3.CameraControl>.value(_FakeCameraControl_1( this, Invocation.method( #getCameraControl, @@ -277,14 +256,14 @@ class MockCamera extends _i1.Mock implements _i9.Camera { ), )), returnValueForMissingStub: - _i16.Future<_i3.CameraControl>.value(_FakeCameraControl_1( + _i15.Future<_i3.CameraControl>.value(_FakeCameraControl_1( this, Invocation.method( #getCameraControl, [], ), )), - ) as _i16.Future<_i3.CameraControl>); + ) as _i15.Future<_i3.CameraControl>); } /// A class which mocks [CameraInfo]. @@ -293,24 +272,23 @@ class MockCamera extends _i1.Mock implements _i9.Camera { // ignore: must_be_immutable class MockCameraInfo extends _i1.Mock implements _i2.CameraInfo { @override - _i16.Future getSensorRotationDegrees() => (super.noSuchMethod( + _i15.Future getSensorRotationDegrees() => (super.noSuchMethod( Invocation.method( #getSensorRotationDegrees, [], ), - returnValue: _i16.Future.value(0), - returnValueForMissingStub: _i16.Future.value(0), - ) as _i16.Future); - + returnValue: _i15.Future.value(0), + returnValueForMissingStub: _i15.Future.value(0), + ) as _i15.Future); @override - _i16.Future<_i4.LiveData<_i18.CameraState>> getCameraState() => + _i15.Future<_i4.LiveData<_i16.CameraState>> getCameraState() => (super.noSuchMethod( Invocation.method( #getCameraState, [], ), - returnValue: _i16.Future<_i4.LiveData<_i18.CameraState>>.value( - _FakeLiveData_2<_i18.CameraState>( + returnValue: _i15.Future<_i4.LiveData<_i16.CameraState>>.value( + _FakeLiveData_2<_i16.CameraState>( this, Invocation.method( #getCameraState, @@ -318,23 +296,22 @@ class MockCameraInfo extends _i1.Mock implements _i2.CameraInfo { ), )), returnValueForMissingStub: - _i16.Future<_i4.LiveData<_i18.CameraState>>.value( - _FakeLiveData_2<_i18.CameraState>( + _i15.Future<_i4.LiveData<_i16.CameraState>>.value( + _FakeLiveData_2<_i16.CameraState>( this, Invocation.method( #getCameraState, [], ), )), - ) as _i16.Future<_i4.LiveData<_i18.CameraState>>); - + ) as _i15.Future<_i4.LiveData<_i16.CameraState>>); @override - _i16.Future<_i5.ExposureState> getExposureState() => (super.noSuchMethod( + _i15.Future<_i5.ExposureState> getExposureState() => (super.noSuchMethod( Invocation.method( #getExposureState, [], ), - returnValue: _i16.Future<_i5.ExposureState>.value(_FakeExposureState_3( + returnValue: _i15.Future<_i5.ExposureState>.value(_FakeExposureState_3( this, Invocation.method( #getExposureState, @@ -342,24 +319,23 @@ class MockCameraInfo extends _i1.Mock implements _i2.CameraInfo { ), )), returnValueForMissingStub: - _i16.Future<_i5.ExposureState>.value(_FakeExposureState_3( + _i15.Future<_i5.ExposureState>.value(_FakeExposureState_3( this, Invocation.method( #getExposureState, [], ), )), - ) as _i16.Future<_i5.ExposureState>); - + ) as _i15.Future<_i5.ExposureState>); @override - _i16.Future<_i4.LiveData<_i19.ZoomState>> getZoomState() => + _i15.Future<_i4.LiveData<_i17.ZoomState>> getZoomState() => (super.noSuchMethod( Invocation.method( #getZoomState, [], ), - returnValue: _i16.Future<_i4.LiveData<_i19.ZoomState>>.value( - _FakeLiveData_2<_i19.ZoomState>( + returnValue: _i15.Future<_i4.LiveData<_i17.ZoomState>>.value( + _FakeLiveData_2<_i17.ZoomState>( this, Invocation.method( #getZoomState, @@ -367,15 +343,15 @@ class MockCameraInfo extends _i1.Mock implements _i2.CameraInfo { ), )), returnValueForMissingStub: - _i16.Future<_i4.LiveData<_i19.ZoomState>>.value( - _FakeLiveData_2<_i19.ZoomState>( + _i15.Future<_i4.LiveData<_i17.ZoomState>>.value( + _FakeLiveData_2<_i17.ZoomState>( this, Invocation.method( #getZoomState, [], ), )), - ) as _i16.Future<_i4.LiveData<_i19.ZoomState>>); + ) as _i15.Future<_i4.LiveData<_i17.ZoomState>>); } /// A class which mocks [CameraControl]. @@ -384,24 +360,23 @@ class MockCameraInfo extends _i1.Mock implements _i2.CameraInfo { // ignore: must_be_immutable class MockCameraControl extends _i1.Mock implements _i3.CameraControl { @override - _i16.Future enableTorch(bool? torch) => (super.noSuchMethod( + _i15.Future enableTorch(bool? torch) => (super.noSuchMethod( Invocation.method( #enableTorch, [torch], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); @override - _i16.Future setZoomRatio(double? ratio) => (super.noSuchMethod( + _i15.Future setZoomRatio(double? ratio) => (super.noSuchMethod( Invocation.method( #setZoomRatio, [ratio], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); } /// A class which mocks [CameraImageData]. @@ -421,21 +396,18 @@ class MockCameraImageData extends _i1.Mock implements _i6.CameraImageData { Invocation.getter(#format), ), ) as _i6.CameraImageFormat); - @override int get height => (super.noSuchMethod( Invocation.getter(#height), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override int get width => (super.noSuchMethod( Invocation.getter(#width), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override List<_i6.CameraImagePlane> get planes => (super.noSuchMethod( Invocation.getter(#planes), @@ -448,19 +420,19 @@ class MockCameraImageData extends _i1.Mock implements _i6.CameraImageData { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockCameraSelector extends _i1.Mock implements _i20.CameraSelector { +class MockCameraSelector extends _i1.Mock implements _i18.CameraSelector { @override - _i16.Future> filter(List<_i2.CameraInfo>? cameraInfos) => + _i15.Future> filter(List<_i2.CameraInfo>? cameraInfos) => (super.noSuchMethod( Invocation.method( #filter, [cameraInfos], ), returnValue: - _i16.Future>.value(<_i2.CameraInfo>[]), + _i15.Future>.value(<_i2.CameraInfo>[]), returnValueForMissingStub: - _i16.Future>.value(<_i2.CameraInfo>[]), - ) as _i16.Future>); + _i15.Future>.value(<_i2.CameraInfo>[]), + ) as _i15.Future>); } /// A class which mocks [ExposureState]. @@ -481,7 +453,6 @@ class MockExposureState extends _i1.Mock implements _i5.ExposureState { Invocation.getter(#exposureCompensationRange), ), ) as _i7.ExposureCompensationRange); - @override double get exposureCompensationStep => (super.noSuchMethod( Invocation.getter(#exposureCompensationStep), @@ -490,211 +461,118 @@ class MockExposureState extends _i1.Mock implements _i5.ExposureState { ) as double); } -/// A class which mocks [FallbackStrategy]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockFallbackStrategy extends _i1.Mock implements _i21.FallbackStrategy { - @override - _i7.VideoQuality get quality => (super.noSuchMethod( - Invocation.getter(#quality), - returnValue: _i7.VideoQuality.SD, - returnValueForMissingStub: _i7.VideoQuality.SD, - ) as _i7.VideoQuality); - - @override - _i7.VideoResolutionFallbackRule get fallbackRule => (super.noSuchMethod( - Invocation.getter(#fallbackRule), - returnValue: _i7.VideoResolutionFallbackRule.higherQualityOrLowerThan, - returnValueForMissingStub: - _i7.VideoResolutionFallbackRule.higherQualityOrLowerThan, - ) as _i7.VideoResolutionFallbackRule); -} - /// A class which mocks [ImageAnalysis]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockImageAnalysis extends _i1.Mock implements _i22.ImageAnalysis { +class MockImageAnalysis extends _i1.Mock implements _i19.ImageAnalysis { @override - _i16.Future setAnalyzer(_i15.Analyzer? analyzer) => (super.noSuchMethod( + _i15.Future setAnalyzer(_i20.Analyzer? analyzer) => (super.noSuchMethod( Invocation.method( #setAnalyzer, [analyzer], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); @override - _i16.Future clearAnalyzer() => (super.noSuchMethod( + _i15.Future clearAnalyzer() => (super.noSuchMethod( Invocation.method( #clearAnalyzer, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); } /// A class which mocks [ImageCapture]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockImageCapture extends _i1.Mock implements _i23.ImageCapture { +class MockImageCapture extends _i1.Mock implements _i21.ImageCapture { @override - _i16.Future setFlashMode(int? newFlashMode) => (super.noSuchMethod( + _i15.Future setFlashMode(int? newFlashMode) => (super.noSuchMethod( Invocation.method( #setFlashMode, [newFlashMode], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); @override - _i16.Future takePicture() => (super.noSuchMethod( + _i15.Future takePicture() => (super.noSuchMethod( Invocation.method( #takePicture, [], ), - returnValue: _i16.Future.value(_i24.dummyValue( - this, - Invocation.method( - #takePicture, - [], - ), - )), - returnValueForMissingStub: - _i16.Future.value(_i24.dummyValue( - this, - Invocation.method( - #takePicture, - [], - ), - )), - ) as _i16.Future); + returnValue: _i15.Future.value(''), + returnValueForMissingStub: _i15.Future.value(''), + ) as _i15.Future); } /// A class which mocks [ImageProxy]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockImageProxy extends _i1.Mock implements _i17.ImageProxy { +class MockImageProxy extends _i1.Mock implements _i22.ImageProxy { @override int get format => (super.noSuchMethod( Invocation.getter(#format), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override int get height => (super.noSuchMethod( Invocation.getter(#height), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override int get width => (super.noSuchMethod( Invocation.getter(#width), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override - _i16.Future> getPlanes() => (super.noSuchMethod( + _i15.Future> getPlanes() => (super.noSuchMethod( Invocation.method( #getPlanes, [], ), returnValue: - _i16.Future>.value(<_i25.PlaneProxy>[]), + _i15.Future>.value(<_i23.PlaneProxy>[]), returnValueForMissingStub: - _i16.Future>.value(<_i25.PlaneProxy>[]), - ) as _i16.Future>); - + _i15.Future>.value(<_i23.PlaneProxy>[]), + ) as _i15.Future>); @override - _i16.Future close() => (super.noSuchMethod( + _i15.Future close() => (super.noSuchMethod( Invocation.method( #close, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); -} - -/// A class which mocks [Observer]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockObserver extends _i1.Mock implements _i26.Observer<_i18.CameraState> { - @override - void Function(Object) get onChanged => (super.noSuchMethod( - Invocation.getter(#onChanged), - returnValue: (Object value) {}, - returnValueForMissingStub: (Object value) {}, - ) as void Function(Object)); - - @override - set onChanged(void Function(Object)? _onChanged) => super.noSuchMethod( - Invocation.setter( - #onChanged, - _onChanged, - ), - returnValueForMissingStub: null, - ); -} - -/// A class which mocks [PendingRecording]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockPendingRecording extends _i1.Mock implements _i10.PendingRecording { - @override - _i16.Future<_i8.Recording> start() => (super.noSuchMethod( - Invocation.method( - #start, - [], - ), - returnValue: _i16.Future<_i8.Recording>.value(_FakeRecording_6( - this, - Invocation.method( - #start, - [], - ), - )), - returnValueForMissingStub: - _i16.Future<_i8.Recording>.value(_FakeRecording_6( - this, - Invocation.method( - #start, - [], - ), - )), - ) as _i16.Future<_i8.Recording>); + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); } /// A class which mocks [PlaneProxy]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockPlaneProxy extends _i1.Mock implements _i25.PlaneProxy { +class MockPlaneProxy extends _i1.Mock implements _i23.PlaneProxy { @override - _i27.Uint8List get buffer => (super.noSuchMethod( + _i24.Uint8List get buffer => (super.noSuchMethod( Invocation.getter(#buffer), - returnValue: _i27.Uint8List(0), - returnValueForMissingStub: _i27.Uint8List(0), - ) as _i27.Uint8List); - + returnValue: _i24.Uint8List(0), + returnValueForMissingStub: _i24.Uint8List(0), + ) as _i24.Uint8List); @override int get pixelStride => (super.noSuchMethod( Invocation.getter(#pixelStride), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override int get rowStride => (super.noSuchMethod( Invocation.getter(#rowStride), @@ -707,17 +585,16 @@ class MockPlaneProxy extends _i1.Mock implements _i25.PlaneProxy { /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockPreview extends _i1.Mock implements _i28.Preview { +class MockPreview extends _i1.Mock implements _i25.Preview { @override - _i16.Future setSurfaceProvider() => (super.noSuchMethod( + _i15.Future setSurfaceProvider() => (super.noSuchMethod( Invocation.method( #setSurfaceProvider, [], ), - returnValue: _i16.Future.value(0), - returnValueForMissingStub: _i16.Future.value(0), - ) as _i16.Future); - + returnValue: _i15.Future.value(0), + returnValueForMissingStub: _i15.Future.value(0), + ) as _i15.Future); @override void releaseFlutterSurfaceTexture() => super.noSuchMethod( Invocation.method( @@ -726,15 +603,14 @@ class MockPreview extends _i1.Mock implements _i28.Preview { ), returnValueForMissingStub: null, ); - @override - _i16.Future<_i7.ResolutionInfo> getResolutionInfo() => (super.noSuchMethod( + _i15.Future<_i7.ResolutionInfo> getResolutionInfo() => (super.noSuchMethod( Invocation.method( #getResolutionInfo, [], ), returnValue: - _i16.Future<_i7.ResolutionInfo>.value(_FakeResolutionInfo_7( + _i15.Future<_i7.ResolutionInfo>.value(_FakeResolutionInfo_6( this, Invocation.method( #getResolutionInfo, @@ -742,14 +618,14 @@ class MockPreview extends _i1.Mock implements _i28.Preview { ), )), returnValueForMissingStub: - _i16.Future<_i7.ResolutionInfo>.value(_FakeResolutionInfo_7( + _i15.Future<_i7.ResolutionInfo>.value(_FakeResolutionInfo_6( this, Invocation.method( #getResolutionInfo, [], ), )), - ) as _i16.Future<_i7.ResolutionInfo>); + ) as _i15.Future<_i7.ResolutionInfo>); } /// A class which mocks [ProcessCameraProvider]. @@ -757,24 +633,23 @@ class MockPreview extends _i1.Mock implements _i28.Preview { /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockProcessCameraProvider extends _i1.Mock - implements _i29.ProcessCameraProvider { + implements _i26.ProcessCameraProvider { @override - _i16.Future> getAvailableCameraInfos() => + _i15.Future> getAvailableCameraInfos() => (super.noSuchMethod( Invocation.method( #getAvailableCameraInfos, [], ), returnValue: - _i16.Future>.value(<_i2.CameraInfo>[]), + _i15.Future>.value(<_i2.CameraInfo>[]), returnValueForMissingStub: - _i16.Future>.value(<_i2.CameraInfo>[]), - ) as _i16.Future>); - + _i15.Future>.value(<_i2.CameraInfo>[]), + ) as _i15.Future>); @override - _i16.Future<_i9.Camera> bindToLifecycle( - _i20.CameraSelector? cameraSelector, - List<_i30.UseCase>? useCases, + _i15.Future<_i8.Camera> bindToLifecycle( + _i18.CameraSelector? cameraSelector, + List<_i27.UseCase>? useCases, ) => (super.noSuchMethod( Invocation.method( @@ -784,7 +659,7 @@ class MockProcessCameraProvider extends _i1.Mock useCases, ], ), - returnValue: _i16.Future<_i9.Camera>.value(_FakeCamera_8( + returnValue: _i15.Future<_i8.Camera>.value(_FakeCamera_7( this, Invocation.method( #bindToLifecycle, @@ -794,7 +669,7 @@ class MockProcessCameraProvider extends _i1.Mock ], ), )), - returnValueForMissingStub: _i16.Future<_i9.Camera>.value(_FakeCamera_8( + returnValueForMissingStub: _i15.Future<_i8.Camera>.value(_FakeCamera_7( this, Invocation.method( #bindToLifecycle, @@ -804,27 +679,24 @@ class MockProcessCameraProvider extends _i1.Mock ], ), )), - ) as _i16.Future<_i9.Camera>); - + ) as _i15.Future<_i8.Camera>); @override - _i16.Future isBound(_i30.UseCase? useCase) => (super.noSuchMethod( + _i15.Future isBound(_i27.UseCase? useCase) => (super.noSuchMethod( Invocation.method( #isBound, [useCase], ), - returnValue: _i16.Future.value(false), - returnValueForMissingStub: _i16.Future.value(false), - ) as _i16.Future); - + returnValue: _i15.Future.value(false), + returnValueForMissingStub: _i15.Future.value(false), + ) as _i15.Future); @override - void unbind(List<_i30.UseCase>? useCases) => super.noSuchMethod( + void unbind(List<_i27.UseCase>? useCases) => super.noSuchMethod( Invocation.method( #unbind, [useCases], ), returnValueForMissingStub: null, ); - @override void unbindAll() => super.noSuchMethod( Invocation.method( @@ -835,33 +707,20 @@ class MockProcessCameraProvider extends _i1.Mock ); } -/// A class which mocks [QualitySelector]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockQualitySelector extends _i1.Mock implements _i31.QualitySelector { - @override - List<_i7.VideoQualityData> get qualityList => (super.noSuchMethod( - Invocation.getter(#qualityList), - returnValue: <_i7.VideoQualityData>[], - returnValueForMissingStub: <_i7.VideoQualityData>[], - ) as List<_i7.VideoQualityData>); -} - /// A class which mocks [Recorder]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockRecorder extends _i1.Mock implements _i11.Recorder { @override - _i16.Future<_i10.PendingRecording> prepareRecording(String? path) => + _i15.Future<_i9.PendingRecording> prepareRecording(String? path) => (super.noSuchMethod( Invocation.method( #prepareRecording, [path], ), returnValue: - _i16.Future<_i10.PendingRecording>.value(_FakePendingRecording_9( + _i15.Future<_i9.PendingRecording>.value(_FakePendingRecording_8( this, Invocation.method( #prepareRecording, @@ -869,88 +728,100 @@ class MockRecorder extends _i1.Mock implements _i11.Recorder { ), )), returnValueForMissingStub: - _i16.Future<_i10.PendingRecording>.value(_FakePendingRecording_9( + _i15.Future<_i9.PendingRecording>.value(_FakePendingRecording_8( this, Invocation.method( #prepareRecording, [path], ), )), - ) as _i16.Future<_i10.PendingRecording>); + ) as _i15.Future<_i9.PendingRecording>); } -/// A class which mocks [ResolutionSelector]. -/// -/// See the documentation for Mockito's code generation for more information. -// ignore: must_be_immutable -class MockResolutionSelector extends _i1.Mock - implements _i32.ResolutionSelector {} - -/// A class which mocks [ResolutionStrategy]. +/// A class which mocks [PendingRecording]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockResolutionStrategy extends _i1.Mock - implements _i33.ResolutionStrategy {} +class MockPendingRecording extends _i1.Mock implements _i9.PendingRecording { + @override + _i15.Future<_i10.Recording> start() => (super.noSuchMethod( + Invocation.method( + #start, + [], + ), + returnValue: _i15.Future<_i10.Recording>.value(_FakeRecording_9( + this, + Invocation.method( + #start, + [], + ), + )), + returnValueForMissingStub: + _i15.Future<_i10.Recording>.value(_FakeRecording_9( + this, + Invocation.method( + #start, + [], + ), + )), + ) as _i15.Future<_i10.Recording>); +} /// A class which mocks [Recording]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockRecording extends _i1.Mock implements _i8.Recording { +class MockRecording extends _i1.Mock implements _i10.Recording { @override - _i16.Future close() => (super.noSuchMethod( + _i15.Future close() => (super.noSuchMethod( Invocation.method( #close, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); @override - _i16.Future pause() => (super.noSuchMethod( + _i15.Future pause() => (super.noSuchMethod( Invocation.method( #pause, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); @override - _i16.Future resume() => (super.noSuchMethod( + _i15.Future resume() => (super.noSuchMethod( Invocation.method( #resume, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); @override - _i16.Future stop() => (super.noSuchMethod( + _i15.Future stop() => (super.noSuchMethod( Invocation.method( #stop, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); } /// A class which mocks [VideoCapture]. /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockVideoCapture extends _i1.Mock implements _i34.VideoCapture { +class MockVideoCapture extends _i1.Mock implements _i28.VideoCapture { @override - _i16.Future<_i11.Recorder> getOutput() => (super.noSuchMethod( + _i15.Future<_i11.Recorder> getOutput() => (super.noSuchMethod( Invocation.method( #getOutput, [], ), - returnValue: _i16.Future<_i11.Recorder>.value(_FakeRecorder_10( + returnValue: _i15.Future<_i11.Recorder>.value(_FakeRecorder_10( this, Invocation.method( #getOutput, @@ -958,14 +829,14 @@ class MockVideoCapture extends _i1.Mock implements _i34.VideoCapture { ), )), returnValueForMissingStub: - _i16.Future<_i11.Recorder>.value(_FakeRecorder_10( + _i15.Future<_i11.Recorder>.value(_FakeRecorder_10( this, Invocation.method( #getOutput, [], ), )), - ) as _i16.Future<_i11.Recorder>); + ) as _i15.Future<_i11.Recorder>); } /// A class which mocks [BuildContext]. @@ -984,21 +855,18 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { Invocation.getter(#widget), ), ) as _i12.Widget); - @override bool get mounted => (super.noSuchMethod( Invocation.getter(#mounted), returnValue: false, returnValueForMissingStub: false, ) as bool); - @override bool get debugDoingBuild => (super.noSuchMethod( Invocation.getter(#debugDoingBuild), returnValue: false, returnValueForMissingStub: false, ) as bool); - @override _i12.InheritedWidget dependOnInheritedElement( _i12.InheritedElement? ancestor, { @@ -1027,7 +895,6 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { ), ), ) as _i12.InheritedWidget); - @override void visitAncestorElements(_i12.ConditionalElementVisitor? visitor) => super.noSuchMethod( @@ -1037,7 +904,6 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { ), returnValueForMissingStub: null, ); - @override void visitChildElements(_i12.ElementVisitor? visitor) => super.noSuchMethod( Invocation.method( @@ -1046,7 +912,6 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { ), returnValueForMissingStub: null, ); - @override void dispatchNotification(_i12.Notification? notification) => super.noSuchMethod( @@ -1056,7 +921,6 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { ), returnValueForMissingStub: null, ); - @override _i14.DiagnosticsNode describeElement( String? name, { @@ -1085,7 +949,6 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { ), ), ) as _i14.DiagnosticsNode); - @override _i14.DiagnosticsNode describeWidget( String? name, { @@ -1114,7 +977,6 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { ), ), ) as _i14.DiagnosticsNode); - @override List<_i14.DiagnosticsNode> describeMissingAncestor( {required Type? expectedAncestorType}) => @@ -1127,7 +989,6 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { returnValue: <_i14.DiagnosticsNode>[], returnValueForMissingStub: <_i14.DiagnosticsNode>[], ) as List<_i14.DiagnosticsNode>); - @override _i14.DiagnosticsNode describeOwnershipChain(String? name) => (super.noSuchMethod( @@ -1156,7 +1017,7 @@ class MockBuildContext extends _i1.Mock implements _i12.BuildContext { /// /// See the documentation for Mockito's code generation for more information. class MockTestInstanceManagerHostApi extends _i1.Mock - implements _i35.TestInstanceManagerHostApi { + implements _i29.TestInstanceManagerHostApi { @override void clear() => super.noSuchMethod( Invocation.method( @@ -1171,20 +1032,19 @@ class MockTestInstanceManagerHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestSystemServicesHostApi extends _i1.Mock - implements _i35.TestSystemServicesHostApi { + implements _i29.TestSystemServicesHostApi { @override - _i16.Future<_i7.CameraPermissionsErrorData?> requestCameraPermissions( + _i15.Future<_i7.CameraPermissionsErrorData?> requestCameraPermissions( bool? enableAudio) => (super.noSuchMethod( Invocation.method( #requestCameraPermissions, [enableAudio], ), - returnValue: _i16.Future<_i7.CameraPermissionsErrorData?>.value(), + returnValue: _i15.Future<_i7.CameraPermissionsErrorData?>.value(), returnValueForMissingStub: - _i16.Future<_i7.CameraPermissionsErrorData?>.value(), - ) as _i16.Future<_i7.CameraPermissionsErrorData?>); - + _i15.Future<_i7.CameraPermissionsErrorData?>.value(), + ) as _i15.Future<_i7.CameraPermissionsErrorData?>); @override void startListeningForDeviceOrientationChange( bool? isFrontFacing, @@ -1200,7 +1060,6 @@ class MockTestSystemServicesHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void stopListeningForDeviceOrientationChange() => super.noSuchMethod( Invocation.method( @@ -1209,7 +1068,6 @@ class MockTestSystemServicesHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override String getTempFilePath( String? prefix, @@ -1223,26 +1081,8 @@ class MockTestSystemServicesHostApi extends _i1.Mock suffix, ], ), - returnValue: _i24.dummyValue( - this, - Invocation.method( - #getTempFilePath, - [ - prefix, - suffix, - ], - ), - ), - returnValueForMissingStub: _i24.dummyValue( - this, - Invocation.method( - #getTempFilePath, - [ - prefix, - suffix, - ], - ), - ), + returnValue: '', + returnValueForMissingStub: '', ) as String); } @@ -1250,14 +1090,13 @@ class MockTestSystemServicesHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable -class MockZoomState extends _i1.Mock implements _i19.ZoomState { +class MockZoomState extends _i1.Mock implements _i17.ZoomState { @override double get minZoomRatio => (super.noSuchMethod( Invocation.getter(#minZoomRatio), returnValue: 0.0, returnValueForMissingStub: 0.0, ) as double); - @override double get maxZoomRatio => (super.noSuchMethod( Invocation.getter(#maxZoomRatio), @@ -1271,31 +1110,30 @@ class MockZoomState extends _i1.Mock implements _i19.ZoomState { /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockLiveCameraState extends _i1.Mock - implements _i4.LiveData<_i18.CameraState> { + implements _i4.LiveData<_i16.CameraState> { MockLiveCameraState() { _i1.throwOnMissingStub(this); } @override - _i16.Future observe(_i26.Observer<_i18.CameraState>? observer) => + _i15.Future observe(_i30.Observer<_i16.CameraState>? observer) => (super.noSuchMethod( Invocation.method( #observe, [observer], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); @override - _i16.Future removeObservers() => (super.noSuchMethod( + _i15.Future removeObservers() => (super.noSuchMethod( Invocation.method( #removeObservers, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); } /// A class which mocks [LiveData]. @@ -1303,29 +1141,28 @@ class MockLiveCameraState extends _i1.Mock /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockLiveZoomState extends _i1.Mock - implements _i4.LiveData<_i19.ZoomState> { + implements _i4.LiveData<_i17.ZoomState> { MockLiveZoomState() { _i1.throwOnMissingStub(this); } @override - _i16.Future observe(_i26.Observer<_i19.ZoomState>? observer) => + _i15.Future observe(_i30.Observer<_i17.ZoomState>? observer) => (super.noSuchMethod( Invocation.method( #observe, [observer], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); - + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); @override - _i16.Future removeObservers() => (super.noSuchMethod( + _i15.Future removeObservers() => (super.noSuchMethod( Invocation.method( #removeObservers, [], ), - returnValue: _i16.Future.value(), - returnValueForMissingStub: _i16.Future.value(), - ) as _i16.Future); + returnValue: _i15.Future.value(), + returnValueForMissingStub: _i15.Future.value(), + ) as _i15.Future); } diff --git a/packages/camera/camera_android_camerax/test/aspect_ratio_strategy_test.mocks.dart b/packages/camera/camera_android_camerax/test/aspect_ratio_strategy_test.mocks.dart index 57ebd94c7d9d..28dda66896e0 100644 --- a/packages/camera/camera_android_camerax/test/aspect_ratio_strategy_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/aspect_ratio_strategy_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/aspect_ratio_strategy_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/camera_control_test.mocks.dart b/packages/camera/camera_android_camerax/test/camera_control_test.mocks.dart index 7e89d6c8c893..519fc6236695 100644 --- a/packages/camera/camera_android_camerax/test/camera_control_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/camera_control_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/camera_control_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -13,8 +15,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -47,7 +47,6 @@ class MockTestCameraControlHostApi extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future setZoomRatio( int? identifier, diff --git a/packages/camera/camera_android_camerax/test/camera_info_test.mocks.dart b/packages/camera/camera_android_camerax/test/camera_info_test.mocks.dart index 074be3bc4acd..8de0b8dfc69b 100644 --- a/packages/camera/camera_android_camerax/test/camera_info_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/camera_info_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/camera_info_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; @@ -17,8 +19,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -43,7 +43,6 @@ class MockTestCameraInfoHostApi extends _i1.Mock ), returnValue: 0, ) as int); - @override int getCameraState(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -52,7 +51,6 @@ class MockTestCameraInfoHostApi extends _i1.Mock ), returnValue: 0, ) as int); - @override int getExposureState(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -61,7 +59,6 @@ class MockTestCameraInfoHostApi extends _i1.Mock ), returnValue: 0, ) as int); - @override int getZoomState(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -111,7 +108,6 @@ class MockLiveCameraState extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObservers() => (super.noSuchMethod( Invocation.method( @@ -143,7 +139,6 @@ class MockLiveZoomState extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObservers() => (super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/camera_selector_test.mocks.dart b/packages/camera/camera_android_camerax/test/camera_selector_test.mocks.dart index 9a0c64b4339b..ec1277537901 100644 --- a/packages/camera/camera_android_camerax/test/camera_selector_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/camera_selector_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/camera_selector_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -44,7 +44,6 @@ class MockTestCameraSelectorHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override List filter( int? identifier, diff --git a/packages/camera/camera_android_camerax/test/camera_state_error_test.mocks.dart b/packages/camera/camera_android_camerax/test/camera_state_error_test.mocks.dart index c1cdf1711d9c..fe9edb7d0b17 100644 --- a/packages/camera/camera_android_camerax/test/camera_state_error_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/camera_state_error_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/camera_state_error_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/camera_state_test.mocks.dart b/packages/camera/camera_android_camerax/test/camera_state_test.mocks.dart index c57714d2c753..93a2e3de0ec2 100644 --- a/packages/camera/camera_android_camerax/test/camera_state_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/camera_state_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/camera_state_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/camera_test.mocks.dart b/packages/camera/camera_android_camerax/test/camera_test.mocks.dart index 6a5336becd9b..7bae8650bd0c 100644 --- a/packages/camera/camera_android_camerax/test/camera_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/camera_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/camera_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -36,7 +36,6 @@ class MockTestCameraHostApi extends _i1.Mock implements _i2.TestCameraHostApi { ), returnValue: 0, ) as int); - @override int getCameraControl(int? identifier) => (super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/exposure_state_test.mocks.dart b/packages/camera/camera_android_camerax/test/exposure_state_test.mocks.dart index 5c1108a47d50..c6c32c614ede 100644 --- a/packages/camera/camera_android_camerax/test/exposure_state_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/exposure_state_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/exposure_state_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/fallback_strategy_test.mocks.dart b/packages/camera/camera_android_camerax/test/fallback_strategy_test.mocks.dart index 1b4bd488a816..8ba811c7b46b 100644 --- a/packages/camera/camera_android_camerax/test/fallback_strategy_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/fallback_strategy_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/fallback_strategy_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; @@ -12,8 +14,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/image_analysis_test.mocks.dart b/packages/camera/camera_android_camerax/test/image_analysis_test.mocks.dart index 132fceddeb1d..b0df5790b2c3 100644 --- a/packages/camera/camera_android_camerax/test/image_analysis_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/image_analysis_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/image_analysis_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:camera_android_camerax/src/resolution_selector.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; @@ -12,8 +14,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -45,7 +45,6 @@ class MockTestImageAnalysisHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setAnalyzer( int? identifier, @@ -61,7 +60,6 @@ class MockTestImageAnalysisHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void clearAnalyzer(int? identifier) => super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/image_capture_test.mocks.dart b/packages/camera/camera_android_camerax/test/image_capture_test.mocks.dart index 1cd374b75f48..44331c92cff9 100644 --- a/packages/camera/camera_android_camerax/test/image_capture_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/image_capture_test.mocks.dart @@ -1,13 +1,14 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/image_capture_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; -import 'package:camera_android_camerax/src/resolution_selector.dart' as _i5; +import 'package:camera_android_camerax/src/resolution_selector.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i4; import 'test_camerax_library.g.dart' as _i2; @@ -15,8 +16,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -50,7 +49,6 @@ class MockTestImageCaptureHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setFlashMode( int? identifier, @@ -66,20 +64,13 @@ class MockTestImageCaptureHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i3.Future takePicture(int? identifier) => (super.noSuchMethod( Invocation.method( #takePicture, [identifier], ), - returnValue: _i3.Future.value(_i4.dummyValue( - this, - Invocation.method( - #takePicture, - [identifier], - ), - )), + returnValue: _i3.Future.value(''), ) as _i3.Future); } @@ -107,7 +98,7 @@ class MockTestInstanceManagerHostApi extends _i1.Mock /// See the documentation for Mockito's code generation for more information. // ignore: must_be_immutable class MockResolutionSelector extends _i1.Mock - implements _i5.ResolutionSelector { + implements _i4.ResolutionSelector { MockResolutionSelector() { _i1.throwOnMissingStub(this); } diff --git a/packages/camera/camera_android_camerax/test/image_proxy_test.mocks.dart b/packages/camera/camera_android_camerax/test/image_proxy_test.mocks.dart index 1b83f21c08f4..cc9700c815dd 100644 --- a/packages/camera/camera_android_camerax/test/image_proxy_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/image_proxy_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/image_proxy_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -37,7 +37,6 @@ class MockTestImageProxyHostApi extends _i1.Mock ), returnValue: [], ) as List); - @override void close(int? identifier) => super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/live_data_test.mocks.dart b/packages/camera/camera_android_camerax/test/live_data_test.mocks.dart index 8374201747d6..9ec79e910e24 100644 --- a/packages/camera/camera_android_camerax/test/live_data_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/live_data_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/live_data_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; @@ -12,8 +14,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -45,7 +45,6 @@ class MockTestLiveDataHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void removeObservers(int? identifier) => super.noSuchMethod( Invocation.method( @@ -54,7 +53,6 @@ class MockTestLiveDataHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override int? getValue( int? identifier, diff --git a/packages/camera/camera_android_camerax/test/observer_test.mocks.dart b/packages/camera/camera_android_camerax/test/observer_test.mocks.dart index 7baf0cc8d438..56a2bf600d4c 100644 --- a/packages/camera/camera_android_camerax/test/observer_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/observer_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/observer_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/pending_recording_test.mocks.dart b/packages/camera/camera_android_camerax/test/pending_recording_test.mocks.dart index 62ab5ce4d371..6b706ae24485 100644 --- a/packages/camera/camera_android_camerax/test/pending_recording_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/pending_recording_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/pending_recording_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; @@ -14,8 +16,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -79,7 +79,6 @@ class MockRecording extends _i1.Mock implements _i3.Recording { returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future pause() => (super.noSuchMethod( Invocation.method( @@ -89,7 +88,6 @@ class MockRecording extends _i1.Mock implements _i3.Recording { returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future resume() => (super.noSuchMethod( Invocation.method( @@ -99,7 +97,6 @@ class MockRecording extends _i1.Mock implements _i3.Recording { returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future stop() => (super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/plane_proxy_test.mocks.dart b/packages/camera/camera_android_camerax/test/plane_proxy_test.mocks.dart index a17a59be183d..b1ff04cc880a 100644 --- a/packages/camera/camera_android_camerax/test/plane_proxy_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/plane_proxy_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/plane_proxy_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/preview_test.mocks.dart b/packages/camera/camera_android_camerax/test/preview_test.mocks.dart index 98b4f2648885..d56e682ac68e 100644 --- a/packages/camera/camera_android_camerax/test/preview_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/preview_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/preview_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i2; import 'package:camera_android_camerax/src/resolution_selector.dart' as _i4; @@ -13,8 +15,6 @@ import 'test_camerax_library.g.dart' as _i3; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -78,7 +78,6 @@ class MockTestPreviewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override int setSurfaceProvider(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -87,7 +86,6 @@ class MockTestPreviewHostApi extends _i1.Mock ), returnValue: 0, ) as int); - @override void releaseFlutterSurfaceTexture() => super.noSuchMethod( Invocation.method( @@ -96,7 +94,6 @@ class MockTestPreviewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i2.ResolutionInfo getResolutionInfo(int? identifier) => (super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/process_camera_provider_test.mocks.dart b/packages/camera/camera_android_camerax/test/process_camera_provider_test.mocks.dart index 1578fba60c81..194ad0008fba 100644 --- a/packages/camera/camera_android_camerax/test/process_camera_provider_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/process_camera_provider_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/process_camera_provider_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -13,8 +15,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -58,7 +58,6 @@ class MockTestProcessCameraProviderHostApi extends _i1.Mock ), returnValue: _i3.Future.value(0), ) as _i3.Future); - @override List getAvailableCameraInfos(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -67,7 +66,6 @@ class MockTestProcessCameraProviderHostApi extends _i1.Mock ), returnValue: [], ) as List); - @override int bindToLifecycle( int? identifier, @@ -85,7 +83,6 @@ class MockTestProcessCameraProviderHostApi extends _i1.Mock ), returnValue: 0, ) as int); - @override bool isBound( int? identifier, @@ -101,7 +98,6 @@ class MockTestProcessCameraProviderHostApi extends _i1.Mock ), returnValue: false, ) as bool); - @override void unbind( int? identifier, @@ -117,7 +113,6 @@ class MockTestProcessCameraProviderHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void unbindAll(int? identifier) => super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/quality_selector_test.mocks.dart b/packages/camera/camera_android_camerax/test/quality_selector_test.mocks.dart index 751d4253840e..65741af996af 100644 --- a/packages/camera/camera_android_camerax/test/quality_selector_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/quality_selector_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/quality_selector_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i6; @@ -20,8 +22,6 @@ import 'test_camerax_library.g.dart' as _i10; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -78,7 +78,6 @@ class MockCameraInfo extends _i1.Mock implements _i5.CameraInfo { ), returnValue: _i6.Future.value(0), ) as _i6.Future); - @override _i6.Future<_i2.LiveData<_i7.CameraState>> getCameraState() => (super.noSuchMethod( @@ -95,7 +94,6 @@ class MockCameraInfo extends _i1.Mock implements _i5.CameraInfo { ), )), ) as _i6.Future<_i2.LiveData<_i7.CameraState>>); - @override _i6.Future<_i3.ExposureState> getExposureState() => (super.noSuchMethod( Invocation.method( @@ -110,7 +108,6 @@ class MockCameraInfo extends _i1.Mock implements _i5.CameraInfo { ), )), ) as _i6.Future<_i3.ExposureState>); - @override _i6.Future<_i2.LiveData<_i8.ZoomState>> getZoomState() => (super.noSuchMethod( Invocation.method( @@ -142,7 +139,6 @@ class MockFallbackStrategy extends _i1.Mock implements _i9.FallbackStrategy { Invocation.getter(#quality), returnValue: _i4.VideoQuality.SD, ) as _i4.VideoQuality); - @override _i4.VideoResolutionFallbackRule get fallbackRule => (super.noSuchMethod( Invocation.getter(#fallbackRule), @@ -176,7 +172,6 @@ class MockTestQualitySelectorHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i4.ResolutionInfo getResolution( int? cameraInfoId, diff --git a/packages/camera/camera_android_camerax/test/recorder_test.mocks.dart b/packages/camera/camera_android_camerax/test/recorder_test.mocks.dart index d4e1237d5823..7a678e286457 100644 --- a/packages/camera/camera_android_camerax/test/recorder_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/recorder_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/recorder_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i7; @@ -17,8 +19,6 @@ import 'test_camerax_library.g.dart' as _i5; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -138,7 +138,6 @@ class MockTestRecorderHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override int getAspectRatio(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -147,7 +146,6 @@ class MockTestRecorderHostApi extends _i1.Mock ), returnValue: 0, ) as int); - @override int getTargetVideoEncodingBitRate(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -156,7 +154,6 @@ class MockTestRecorderHostApi extends _i1.Mock ), returnValue: 0, ) as int); - @override int prepareRecording( int? identifier, @@ -200,7 +197,6 @@ class MockTestQualitySelectorHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i2.ResolutionInfo getResolution( int? cameraInfoId, diff --git a/packages/camera/camera_android_camerax/test/recording_test.mocks.dart b/packages/camera/camera_android_camerax/test/recording_test.mocks.dart index 520762c19966..91362b6bcde8 100644 --- a/packages/camera/camera_android_camerax/test/recording_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/recording_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/recording_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -37,7 +37,6 @@ class MockTestRecordingHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void pause(int? identifier) => super.noSuchMethod( Invocation.method( @@ -46,7 +45,6 @@ class MockTestRecordingHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void resume(int? identifier) => super.noSuchMethod( Invocation.method( @@ -55,7 +53,6 @@ class MockTestRecordingHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void stop(int? identifier) => super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/resolution_selector_test.mocks.dart b/packages/camera/camera_android_camerax/test/resolution_selector_test.mocks.dart index f754257e2761..6ab8de8316d9 100644 --- a/packages/camera/camera_android_camerax/test/resolution_selector_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/resolution_selector_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/resolution_selector_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:camera_android_camerax/src/aspect_ratio_strategy.dart' as _i2; import 'package:camera_android_camerax/src/resolution_strategy.dart' as _i3; @@ -13,8 +15,6 @@ import 'test_camerax_library.g.dart' as _i4; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -37,7 +37,6 @@ class MockAspectRatioStrategy extends _i1.Mock Invocation.getter(#preferredAspectRatio), returnValue: 0, ) as int); - @override int get fallbackRule => (super.noSuchMethod( Invocation.getter(#fallbackRule), diff --git a/packages/camera/camera_android_camerax/test/resolution_strategy_test.mocks.dart b/packages/camera/camera_android_camerax/test/resolution_strategy_test.mocks.dart index a82dd4c8a461..1a667389bac0 100644 --- a/packages/camera/camera_android_camerax/test/resolution_strategy_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/resolution_strategy_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/resolution_strategy_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; @@ -12,8 +14,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_android_camerax/test/system_services_test.mocks.dart b/packages/camera/camera_android_camerax/test/system_services_test.mocks.dart index bc3b48f24c02..4955031de913 100644 --- a/packages/camera/camera_android_camerax/test/system_services_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/system_services_test.mocks.dart @@ -1,13 +1,14 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/system_services_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; import 'package:camera_android_camerax/src/camerax_library.g.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; import 'test_camerax_library.g.dart' as _i2; @@ -15,8 +16,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -62,7 +61,6 @@ class MockTestSystemServicesHostApi extends _i1.Mock ), returnValue: _i3.Future<_i4.CameraPermissionsErrorData?>.value(), ) as _i3.Future<_i4.CameraPermissionsErrorData?>); - @override void startListeningForDeviceOrientationChange( bool? isFrontFacing, @@ -78,7 +76,6 @@ class MockTestSystemServicesHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void stopListeningForDeviceOrientationChange() => super.noSuchMethod( Invocation.method( @@ -87,7 +84,6 @@ class MockTestSystemServicesHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override String getTempFilePath( String? prefix, @@ -101,15 +97,6 @@ class MockTestSystemServicesHostApi extends _i1.Mock suffix, ], ), - returnValue: _i5.dummyValue( - this, - Invocation.method( - #getTempFilePath, - [ - prefix, - suffix, - ], - ), - ), + returnValue: '', ) as String); } diff --git a/packages/camera/camera_android_camerax/test/video_capture_test.mocks.dart b/packages/camera/camera_android_camerax/test/video_capture_test.mocks.dart index f2f8e54b64bd..0a1034a62f90 100644 --- a/packages/camera/camera_android_camerax/test/video_capture_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/video_capture_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/video_capture_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; @@ -15,8 +17,6 @@ import 'test_camerax_library.g.dart' as _i3; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -52,7 +52,6 @@ class MockTestVideoCaptureHostApi extends _i1.Mock ), returnValue: 0, ) as int); - @override int getOutput(int? identifier) => (super.noSuchMethod( Invocation.method( diff --git a/packages/camera/camera_android_camerax/test/zoom_state_test.mocks.dart b/packages/camera/camera_android_camerax/test/zoom_state_test.mocks.dart index 4517459c6ad6..b904ec4d8231 100644 --- a/packages/camera/camera_android_camerax/test/zoom_state_test.mocks.dart +++ b/packages/camera/camera_android_camerax/test/zoom_state_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in camera_android_camerax/test/zoom_state_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_camerax_library.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/camera/camera_avfoundation/CHANGELOG.md b/packages/camera/camera_avfoundation/CHANGELOG.md index ccc3b46c238e..c487812fab99 100644 --- a/packages/camera/camera_avfoundation/CHANGELOG.md +++ b/packages/camera/camera_avfoundation/CHANGELOG.md @@ -1,6 +1,5 @@ -## 0.9.13+8 +## NEXT -* Updates example app to use non-deprecated video_player method. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 0.9.13+7 diff --git a/packages/camera/camera_avfoundation/example/lib/main.dart b/packages/camera/camera_avfoundation/example/lib/main.dart index 304cd0279eb0..dca906cf26cf 100644 --- a/packages/camera/camera_avfoundation/example/lib/main.dart +++ b/packages/camera/camera_avfoundation/example/lib/main.dart @@ -994,7 +994,11 @@ class _CameraExampleHomeState extends State } final VideoPlayerController vController = kIsWeb - ? VideoPlayerController.networkUrl(Uri.parse(videoFile!.path)) + // TODO(gabrielokura): remove the ignore once the following line can migrate to + // use VideoPlayerController.networkUrl after the issue is resolved. + // https://github.com/flutter/flutter/issues/121927 + // ignore: deprecated_member_use + ? VideoPlayerController.network(videoFile!.path) : VideoPlayerController.file(File(videoFile!.path)); videoPlayerListener = () { diff --git a/packages/camera/camera_avfoundation/example/pubspec.yaml b/packages/camera/camera_avfoundation/example/pubspec.yaml index dd6b5f13d1e4..89ec765581b1 100644 --- a/packages/camera/camera_avfoundation/example/pubspec.yaml +++ b/packages/camera/camera_avfoundation/example/pubspec.yaml @@ -18,7 +18,8 @@ dependencies: flutter: sdk: flutter path_provider: ^2.0.0 - video_player: ^2.7.0 + quiver: ^3.0.0 + video_player: ^2.1.4 dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/camera/camera_avfoundation/pubspec.yaml b/packages/camera/camera_avfoundation/pubspec.yaml index 103859ffb39c..13d4249b848d 100644 --- a/packages/camera/camera_avfoundation/pubspec.yaml +++ b/packages/camera/camera_avfoundation/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_avfoundation description: iOS implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_avfoundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.9.13+8 +version: 0.9.13+7 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/camera/camera_avfoundation/test/avfoundation_camera_test.dart b/packages/camera/camera_avfoundation/test/avfoundation_camera_test.dart index 3f37506b99c6..17b06cddc1ae 100644 --- a/packages/camera/camera_avfoundation/test/avfoundation_camera_test.dart +++ b/packages/camera/camera_avfoundation/test/avfoundation_camera_test.dart @@ -30,7 +30,7 @@ void main() { // Setting up a handler requires bindings to be initialized, and since // registerWith is called very early in initialization the bindings won't - // have been initialized. While registerWith could initialize them, that + // have been initialized. While registerWith could intialize them, that // could slow down startup, so instead the handler should be set up lazily. final ByteData? response = await _ambiguate(TestDefaultBinaryMessengerBinding.instance)! diff --git a/packages/camera/camera_platform_interface/AUTHORS b/packages/camera/camera_platform_interface/AUTHORS index 0d1bfa6a90c7..493a0b4ef9c2 100644 --- a/packages/camera/camera_platform_interface/AUTHORS +++ b/packages/camera/camera_platform_interface/AUTHORS @@ -64,4 +64,3 @@ Aleksandr Yurkovskiy Anton Borries Alex Li Rahul Raj <64.rahulraj@gmail.com> -Mairramer diff --git a/packages/camera/camera_platform_interface/CHANGELOG.md b/packages/camera/camera_platform_interface/CHANGELOG.md index f31511df65a5..f5d581c99b5c 100644 --- a/packages/camera/camera_platform_interface/CHANGELOG.md +++ b/packages/camera/camera_platform_interface/CHANGELOG.md @@ -1,6 +1,5 @@ -## 2.7.0 +## NEXT -* Adds support for setting the image file format. See `CameraPlatform.setImageFileFormat`. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 2.6.0 diff --git a/packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart b/packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart index 7ee0ed4e7b97..35ece04fdf52 100644 --- a/packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart +++ b/packages/camera/camera_platform_interface/lib/src/method_channel/method_channel_camera.dart @@ -529,17 +529,6 @@ class MethodChannelCamera extends CameraPlatform { ); } - @override - Future setImageFileFormat(int cameraId, ImageFileFormat format) { - return _channel.invokeMethod( - 'setImageFileFormat', - { - 'cameraId': cameraId, - 'fileFormat': format.name, - }, - ); - } - @override Widget buildPreview(int cameraId) { return Texture(textureId: cameraId); diff --git a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart index 6707962cbc1f..b74cb4203324 100644 --- a/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart +++ b/packages/camera/camera_platform_interface/lib/src/platform_interface/camera_platform.dart @@ -298,12 +298,4 @@ abstract class CameraPlatform extends PlatformInterface { Future dispose(int cameraId) { throw UnimplementedError('dispose() is not implemented.'); } - - /// Sets the output image file format for the selected camera. - /// - // TODO(bmparr): This is only supported on iOS. See - // https://github.com/flutter/flutter/issues/139588 - Future setImageFileFormat(int cameraId, ImageFileFormat format) { - throw UnimplementedError('setImageFileFormat() is not implemented.'); - } } diff --git a/packages/camera/camera_platform_interface/lib/src/types/image_file_format.dart b/packages/camera/camera_platform_interface/lib/src/types/image_file_format.dart deleted file mode 100644 index e745dc5e1fd6..000000000000 --- a/packages/camera/camera_platform_interface/lib/src/types/image_file_format.dart +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/// The format in which images should be returned from the camera. -enum ImageFileFormat { - /// The JPEG format. - jpeg, - - /// The HEIF format. - /// - /// HEIF is a file format name that refers to High Efficiency Image Format - /// (HEIF). For iOS, this is only supported on versions 11+. - heif, -} diff --git a/packages/camera/camera_platform_interface/lib/src/types/types.dart b/packages/camera/camera_platform_interface/lib/src/types/types.dart index e56b9b4c49a1..f9a81559d680 100644 --- a/packages/camera/camera_platform_interface/lib/src/types/types.dart +++ b/packages/camera/camera_platform_interface/lib/src/types/types.dart @@ -8,7 +8,6 @@ export 'camera_image_data.dart'; export 'exposure_mode.dart'; export 'flash_mode.dart'; export 'focus_mode.dart'; -export 'image_file_format.dart'; export 'image_format_group.dart'; export 'media_settings.dart'; export 'resolution_preset.dart'; diff --git a/packages/camera/camera_platform_interface/pubspec.yaml b/packages/camera/camera_platform_interface/pubspec.yaml index 3bf2055f91c9..e72afcf5a2d8 100644 --- a/packages/camera/camera_platform_interface/pubspec.yaml +++ b/packages/camera/camera_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/camera/camera issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.7.0 +version: 2.6.0 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/camera/camera_platform_interface/test/events/camera_event_test.dart b/packages/camera/camera_platform_interface/test/events/camera_event_test.dart index cb1e34845b3f..074f203bea21 100644 --- a/packages/camera/camera_platform_interface/test/events/camera_event_test.dart +++ b/packages/camera/camera_platform_interface/test/events/camera_event_test.dart @@ -31,7 +31,7 @@ void main() { 'exposureMode': 'auto', 'exposurePointSupported': true, 'focusMode': 'auto', - 'focusPointSupported': true, + 'focusPointSupported': true }); expect(event.cameraId, 1); diff --git a/packages/camera/camera_platform_interface/test/method_channel/method_channel_camera_test.dart b/packages/camera/camera_platform_interface/test/method_channel/method_channel_camera_test.dart index 7cf878b8c385..8159cdfe26f5 100644 --- a/packages/camera/camera_platform_interface/test/method_channel/method_channel_camera_test.dart +++ b/packages/camera/camera_platform_interface/test/method_channel/method_channel_camera_test.dart @@ -1154,46 +1154,6 @@ void main() { isMethodCall('stopImageStream', arguments: null), ]); }); - - test('Should set the ImageFileFormat to heif', () async { - // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: 'plugins.flutter.io/camera', - methods: {'setImageFileFormat': 'heif'}, - ); - - // Act - await camera.setImageFileFormat(cameraId, ImageFileFormat.heif); - - // Assert - expect(channel.log, [ - isMethodCall('setImageFileFormat', arguments: { - 'cameraId': cameraId, - 'fileFormat': 'heif', - }), - ]); - }); - - test('Should set the ImageFileFormat to jpeg', () async { - // Arrange - final MethodChannelMock channel = MethodChannelMock( - channelName: 'plugins.flutter.io/camera', - methods: { - 'setImageFileFormat': 'jpeg', - }, - ); - - // Act - await camera.setImageFileFormat(cameraId, ImageFileFormat.jpeg); - - // Assert - expect(channel.log, [ - isMethodCall('setImageFileFormat', arguments: { - 'cameraId': cameraId, - 'fileFormat': 'jpeg', - }), - ]); - }); }); }); } diff --git a/packages/cross_file/CHANGELOG.md b/packages/cross_file/CHANGELOG.md index 2591d2ea9d22..e5083cd05dad 100644 --- a/packages/cross_file/CHANGELOG.md +++ b/packages/cross_file/CHANGELOG.md @@ -1,11 +1,5 @@ -## 0.3.3+8 +## NEXT -* Now supports `dart2wasm` compilation. -* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. - -## 0.3.3+7 - -* Updates README to improve example of instantiating an XFile. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 0.3.3+6 diff --git a/packages/cross_file/README.md b/packages/cross_file/README.md index bfa7b3db65d7..3bbca28c2f1b 100644 --- a/packages/cross_file/README.md +++ b/packages/cross_file/README.md @@ -10,17 +10,18 @@ access the file and its metadata. Example: - ```dart -final XFile file = XFile('assets/hello.txt'); +import 'package:cross_file/cross_file.dart'; + +final file = XFile('assets/hello.txt'); print('File information:'); print('- Path: ${file.path}'); print('- Name: ${file.name}'); print('- MIME type: ${file.mimeType}'); -final String fileContent = await file.readAsString(); -print('Content of the file: $fileContent'); +final fileContent = await file.readAsString(); +print('Content of the file: ${fileContent}'); // e.g. "Moto G (4)" ``` You will find links to the API docs on the [pub page](https://pub.dev/packages/cross_file). diff --git a/packages/cross_file/example/assets/hello.txt b/packages/cross_file/example/assets/hello.txt deleted file mode 100644 index 5dd01c177f5d..000000000000 --- a/packages/cross_file/example/assets/hello.txt +++ /dev/null @@ -1 +0,0 @@ -Hello, world! \ No newline at end of file diff --git a/packages/cross_file/example/lib/readme_excerpts.dart b/packages/cross_file/example/lib/readme_excerpts.dart deleted file mode 100644 index e2dcdc18cb60..000000000000 --- a/packages/cross_file/example/lib/readme_excerpts.dart +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// ignore_for_file: avoid_print - -import 'package:cross_file/cross_file.dart'; - -/// Demonstrate instantiating an XFile for the README. -Future instantiateXFile() async { - // #docregion Instantiate - final XFile file = XFile('assets/hello.txt'); - - print('File information:'); - print('- Path: ${file.path}'); - print('- Name: ${file.name}'); - print('- MIME type: ${file.mimeType}'); - - final String fileContent = await file.readAsString(); - print('Content of the file: $fileContent'); - // #enddocregion Instantiate - - return file; -} diff --git a/packages/cross_file/example/pubspec.yaml b/packages/cross_file/example/pubspec.yaml deleted file mode 100644 index cfc3baf8aeec..000000000000 --- a/packages/cross_file/example/pubspec.yaml +++ /dev/null @@ -1,18 +0,0 @@ -name: cross_file_example -description: Demonstrates how to use cross files. -publish_to: none - -environment: - sdk: ">=3.0.0 <4.0.0" - -dependencies: - cross_file: - # When depending on this package from a real application you should use: - # cross_file: ^x.y.z - # See https://dart.dev/tools/pub/dependencies#version-constraints - # The example app is bundled with the plugin so we use a path dependency on - # the parent directory to use the current plugin's version. - path: ../ - -dev_dependencies: - test: ^1.24.0 diff --git a/packages/cross_file/example/test/readme_excerpts_test.dart b/packages/cross_file/example/test/readme_excerpts_test.dart deleted file mode 100644 index 93f1adcfb9df..000000000000 --- a/packages/cross_file/example/test/readme_excerpts_test.dart +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:cross_file/cross_file.dart'; -import 'package:cross_file_example/readme_excerpts.dart'; -import 'package:test/test.dart'; - -const bool kIsWeb = bool.fromEnvironment('dart.library.js_interop'); - -void main() { - test('instantiateXFile loads asset file', () async { - // Ensure that the snippet code runs successfully. - final XFile xFile = await instantiateXFile(); - // It should have a nonempty path and name. - expect(xFile.path, allOf(isNotNull, isNotEmpty)); - expect(xFile.name, allOf(isNotNull, isNotEmpty)); - - // And the example file should have contents. - final String fileContent = await xFile.readAsString(); - expect(fileContent, allOf(isNotNull, isNotEmpty)); - }, skip: kIsWeb); -} diff --git a/packages/cross_file/lib/src/types/html.dart b/packages/cross_file/lib/src/types/html.dart index 9eb95b448d88..7f5a1e5396ac 100644 --- a/packages/cross_file/lib/src/types/html.dart +++ b/packages/cross_file/lib/src/types/html.dart @@ -4,11 +4,10 @@ import 'dart:async'; import 'dart:convert'; -import 'dart:js_interop'; +import 'dart:html'; import 'dart:typed_data'; import 'package:meta/meta.dart'; -import 'package:web/helpers.dart'; import '../web_helpers/web_helpers.dart'; import 'base.dart'; @@ -66,9 +65,7 @@ class XFile extends XFileBase { super(path) { if (path == null) { _browserBlob = _createBlobFromBytes(bytes, mimeType); - // TODO(kevmoo): drop ignore when pkg:web constraint excludes v0.3 - // ignore: unnecessary_cast - _path = URL.createObjectURL(_browserBlob! as JSObject); + _path = Url.createObjectUrl(_browserBlob); } else { _path = path; } @@ -77,9 +74,8 @@ class XFile extends XFileBase { // Initializes a Blob from a bunch of `bytes` and an optional `mimeType`. Blob _createBlobFromBytes(Uint8List bytes, String? mimeType) { return (mimeType == null) - ? Blob([bytes.toJS].toJS) - : Blob( - [bytes.toJS].toJS, BlobPropertyBag(type: mimeType)); + ? Blob([bytes]) + : Blob([bytes], mimeType); } // Overridable (meta) data that can be specified by the constructors. @@ -131,13 +127,11 @@ class XFile extends XFileBase { // Attempt to re-hydrate the blob from the `path` via a (local) HttpRequest. // Note that safari hangs if the Blob is >=4GB, so bail out in that case. - // TODO(kevmoo): Remove ignore and fix when the MIN Dart SDK is 3.3 - // ignore: unnecessary_non_null_assertion if (isSafari() && _length != null && _length! >= _fourGigabytes) { throw Exception('Safari cannot handle XFiles larger than 4GB.'); } - late XMLHttpRequest request; + late HttpRequest request; try { request = await HttpRequest.request(path, responseType: 'blob'); } on ProgressEvent catch (e) { @@ -187,8 +181,7 @@ class XFile extends XFileBase { await reader.onLoadEnd.first; - final Uint8List? result = - (reader.result as JSArrayBuffer?)?.toDart.asUint8List(); + final Uint8List? result = reader.result as Uint8List?; if (result == null) { throw Exception('Cannot read bytes from Blob. Is it still available?'); @@ -208,14 +201,12 @@ class XFile extends XFileBase { // Create an tag with the appropriate download attributes and click it // May be overridden with CrossFileTestOverrides - final HTMLAnchorElement element = _hasTestOverrides - ? _overrides!.createAnchorElement(this.path, name) as HTMLAnchorElement + final AnchorElement element = _hasTestOverrides + ? _overrides!.createAnchorElement(this.path, name) as AnchorElement : createAnchorElement(this.path, name); // Clear the children in _target and add an element to click - while (_target.children.length > 0) { - _target.removeChild(_target.children.item(0)!); - } + _target.children.clear(); addElementToContainerAndClick(_target, element); } } diff --git a/packages/cross_file/lib/src/types/io.dart b/packages/cross_file/lib/src/types/io.dart index a6979e53498c..fc34d4966693 100644 --- a/packages/cross_file/lib/src/types/io.dart +++ b/packages/cross_file/lib/src/types/io.dart @@ -82,8 +82,6 @@ class XFile extends XFileBase { await _file.copy(path); } else { final File fileToSave = File(path); - // TODO(kevmoo): Remove ignore and fix when the MIN Dart SDK is 3.3 - // ignore: unnecessary_non_null_assertion await fileToSave.writeAsBytes(_bytes!); } } @@ -108,8 +106,6 @@ class XFile extends XFileBase { @override Future readAsString({Encoding encoding = utf8}) { if (_bytes != null) { - // TODO(kevmoo): Remove ignore and fix when the MIN Dart SDK is 3.3 - // ignore: unnecessary_non_null_assertion return Future.value(String.fromCharCodes(_bytes!)); } return _file.readAsString(encoding: encoding); diff --git a/packages/cross_file/lib/src/web_helpers/web_helpers.dart b/packages/cross_file/lib/src/web_helpers/web_helpers.dart index ec9a2e86e7d7..da023b682159 100644 --- a/packages/cross_file/lib/src/web_helpers/web_helpers.dart +++ b/packages/cross_file/lib/src/web_helpers/web_helpers.dart @@ -2,19 +2,26 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:web/helpers.dart'; +import 'dart:html'; /// Create anchor element with download attribute -HTMLAnchorElement createAnchorElement(String href, String? suggestedName) => - (document.createElement('a') as HTMLAnchorElement) - ..href = href - ..download = suggestedName ?? 'download'; +AnchorElement createAnchorElement(String href, String? suggestedName) { + final AnchorElement element = AnchorElement(href: href); + + if (suggestedName == null) { + element.download = 'download'; + } else { + element.download = suggestedName; + } + + return element; +} /// Add an element to a container and click it -void addElementToContainerAndClick(Element container, HTMLElement element) { +void addElementToContainerAndClick(Element container, Element element) { // Add the element and click it // All previous elements will be removed before adding the new one - container.appendChild(element); + container.children.add(element); element.click(); } @@ -22,9 +29,9 @@ void addElementToContainerAndClick(Element container, HTMLElement element) { Element ensureInitialized(String id) { Element? target = querySelector('#$id'); if (target == null) { - final Element targetElement = document.createElement('flt-x-file')..id = id; + final Element targetElement = Element.tag('flt-x-file')..id = id; - querySelector('body')!.appendChild(targetElement); + querySelector('body')!.children.add(targetElement); target = targetElement; } return target; diff --git a/packages/cross_file/lib/src/x_file.dart b/packages/cross_file/lib/src/x_file.dart index 00dda82f0248..a6022e73920a 100644 --- a/packages/cross_file/lib/src/x_file.dart +++ b/packages/cross_file/lib/src/x_file.dart @@ -3,5 +3,5 @@ // found in the LICENSE file. export 'types/interface.dart' - if (dart.library.js_interop) 'types/html.dart' + if (dart.library.html) 'types/html.dart' if (dart.library.io) 'types/io.dart'; diff --git a/packages/cross_file/pubspec.yaml b/packages/cross_file/pubspec.yaml index c2b8f2f53424..ffcca3c3871f 100644 --- a/packages/cross_file/pubspec.yaml +++ b/packages/cross_file/pubspec.yaml @@ -2,14 +2,14 @@ name: cross_file description: An abstraction to allow working with files across multiple platforms. repository: https://github.com/flutter/packages/tree/main/packages/cross_file issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+cross_file%22 -version: 0.3.3+8 +version: 0.3.3+6 environment: - sdk: ^3.2.0 + sdk: ">=3.0.0 <4.0.0" dependencies: + js: ^0.6.3 meta: ^1.3.0 - web: '>=0.3.0 <0.5.0' dev_dependencies: path: ^1.8.1 diff --git a/packages/cross_file/test/x_file_html_test.dart b/packages/cross_file/test/x_file_html_test.dart index 4e1cac634aee..a19e5098eba0 100644 --- a/packages/cross_file/test/x_file_html_test.dart +++ b/packages/cross_file/test/x_file_html_test.dart @@ -5,21 +5,17 @@ @TestOn('chrome') // Uses web-only Flutter SDK import 'dart:convert'; -import 'dart:js_interop'; +import 'dart:html' as html; import 'dart:typed_data'; import 'package:cross_file/cross_file.dart'; +import 'package:js/js_util.dart' as js_util; import 'package:test/test.dart'; -import 'package:web/helpers.dart' as html; const String expectedStringContents = 'Hello, world! I ❤ ñ! 空手'; final Uint8List bytes = Uint8List.fromList(utf8.encode(expectedStringContents)); -final html.File textFile = - html.File([bytes.toJS].toJS, 'hello.txt'); -final String textFileUrl = - // TODO(kevmoo): drop ignore when pkg:web constraint excludes v0.3 - // ignore: unnecessary_cast - html.URL.createObjectURL(textFile as JSObject); +final html.File textFile = html.File([bytes], 'hello.txt'); +final String textFileUrl = html.Url.createObjectUrl(textFile); void main() { group('Create with an objectUrl', () { @@ -67,16 +63,16 @@ void main() { test('Stores data as a Blob', () async { // Read the blob from its path 'natively' - final html.Response response = - (await html.window.fetch(file.path.toJS).toDart)! as html.Response; - - final JSAny? arrayBuffer = await response.arrayBuffer().toDart; - final ByteBuffer data = (arrayBuffer! as JSArrayBuffer).toDart; + final Object response = await html.window.fetch(file.path) as Object; + // Call '.arrayBuffer()' on the fetch response object to look at its bytes. + final ByteBuffer data = await js_util.promiseToFuture( + js_util.callMethod(response, 'arrayBuffer', []), + ); expect(data.asUint8List(), equals(bytes)); }); test('Data may be purged from the blob!', () async { - html.URL.revokeObjectURL(file.path); + html.Url.revokeObjectUrl(file.path); expect(() async { await file.readAsBytes(); @@ -106,15 +102,9 @@ void main() { final html.Element container = html.querySelector('#$crossFileDomElementId')!; - - late html.HTMLAnchorElement element; - for (int i = 0; i < container.childNodes.length; i++) { - final html.Element test = container.children.item(i)!; - if (test.tagName == 'A') { - element = test as html.HTMLAnchorElement; - break; - } - } + final html.AnchorElement element = container.children + .firstWhere((html.Element element) => element.tagName == 'A') + as html.AnchorElement; // if element is not found, the `firstWhere` call will throw StateError. expect(element.href, file.path); @@ -122,8 +112,7 @@ void main() { }); test('anchor element is clicked', () async { - final html.HTMLAnchorElement mockAnchor = - html.document.createElement('a') as html.HTMLAnchorElement; + final html.AnchorElement mockAnchor = html.AnchorElement(); final CrossFileTestOverrides overrides = CrossFileTestOverrides( createAnchorElement: (_, __) => mockAnchor, diff --git a/packages/css_colors/CHANGELOG.md b/packages/css_colors/CHANGELOG.md index 72fc00b91ca4..44b20dbfd206 100644 --- a/packages/css_colors/CHANGELOG.md +++ b/packages/css_colors/CHANGELOG.md @@ -1,7 +1,6 @@ -## 1.1.4 +## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Improves README example and updates it to use code excerpts. ## 1.1.3 diff --git a/packages/css_colors/README.md b/packages/css_colors/README.md index fba6306e3319..0cf989019d99 100644 --- a/packages/css_colors/README.md +++ b/packages/css_colors/README.md @@ -5,10 +5,16 @@ This package defines color constants for the CSS colors. These color constants use the [Color](https://api.flutter.dev/flutter/dart-ui/Color-class.html) class from `dart:ui`, which means they're useful for Flutter apps. +Import +------ + +```dart +import 'package:css_colors/css_colors.dart'; +``` + Use --- - ```dart -final Container orange = Container(color: CSSColors.orange); +new Container(color: CSSColors.orange) ``` diff --git a/packages/css_colors/pubspec.yaml b/packages/css_colors/pubspec.yaml index b999cfe3f29a..b28dea589a5f 100644 --- a/packages/css_colors/pubspec.yaml +++ b/packages/css_colors/pubspec.yaml @@ -2,7 +2,7 @@ name: css_colors description: Defines constant dart:ui Color objects for CSS colors (for use in Flutter code). repository: https://github.com/flutter/packages/tree/main/packages/css_colors issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+css_colors%22 -version: 1.1.4 +version: 1.1.3 environment: sdk: ">=3.0.0 <4.0.0" @@ -11,8 +11,6 @@ environment: dependencies: flutter: sdk: flutter - flutter_test: - sdk: flutter topics: - color diff --git a/packages/css_colors/test/css_colors_test.dart b/packages/css_colors/test/css_colors_test.dart deleted file mode 100644 index 024e17e261ff..000000000000 --- a/packages/css_colors/test/css_colors_test.dart +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:css_colors/css_colors.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - testWidgets('CSSColors.orange should be correct', - (WidgetTester tester) async { - // Create a Container widget using CSSColors.orange. - // #docregion Usage - final Container orange = Container(color: CSSColors.orange); - // #enddocregion Usage - - // Ensure the color of the container is the expected one. - expect(orange.color, equals(const Color(0xFFFFA500))); - }); -} diff --git a/packages/dynamic_layouts/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/dynamic_layouts/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/dynamic_layouts/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/dynamic_layouts/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/espresso/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/espresso/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/espresso/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/espresso/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md b/packages/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md index 4d98d664590b..682ad3a146f8 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md +++ b/packages/extension_google_sign_in_as_googleapis_auth/CHANGELOG.md @@ -1,7 +1,6 @@ -## 2.0.12 +## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Updates README to improve example of using google_sign_in plugin with the `googleapis` package. ## 2.0.11 diff --git a/packages/extension_google_sign_in_as_googleapis_auth/README.md b/packages/extension_google_sign_in_as_googleapis_auth/README.md index ddc66711d401..2f8a376c47d0 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/README.md +++ b/packages/extension_google_sign_in_as_googleapis_auth/README.md @@ -1,6 +1,6 @@ # extension_google_sign_in_as_googleapis_auth -A bridge package between Flutter's [`google_sign_in` plugin](https://pub.dev/packages/google_sign_in) and Dart's [`googleapis` package](https://pub.dev/packages/googleapis), that is able to create [`googleapis_auth`-like `AuthClient` instances](https://pub.dev/documentation/googleapis_auth/latest/googleapis_auth/AuthClient-class.html) directly from the `GoogleSignIn` plugin. +A bridge package between Flutter's [`google_sign_in` plugin](https://pub.dev/packages/google_sign_in) and Dart's [`googleapis` package](https://pub.dev/packages/googleapis), that is able to create [`googleapis_auth`-like `AuthClient` instances](https://pub.dev/documentation/googleapis_auth/latest/googleapis_auth.auth/AuthClient-class.html) directly from the `GoogleSignIn` plugin. ## Usage @@ -8,7 +8,6 @@ This package is implemented as an [extension method](https://dart.dev/guides/lan In order to use it, you need to add a `dependency` to your `pubspec.yaml`. Then, wherever you're importing `package:google_sign_in/google_sign_in.dart`, add the following: - ```dart import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart'; ``` @@ -17,18 +16,9 @@ From that moment on, your `GoogleSignIn` instance will have an additional `Futur That object can then be used to create instances of `googleapis` API clients: - ```dart -// Retrieve an [auth.AuthClient] from the current [GoogleSignIn] instance. -final auth.AuthClient? client = await _googleSignIn.authenticatedClient(); - -assert(client != null, 'Authenticated client missing!'); - -// Prepare a People Service authenticated client. -final PeopleServiceApi peopleApi = PeopleServiceApi(client!); -// Retrieve a list of the `names` of my `connections` -final ListConnectionsResponse response = - await peopleApi.people.connections.list( +final peopleApi = PeopleApi((await _googleSignIn.authenticatedClient())!); +final response = await peopleApi.people.connections.list( 'people/me', personFields: 'names', ); diff --git a/packages/extension_google_sign_in_as_googleapis_auth/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/extension_google_sign_in_as_googleapis_auth/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/extension_google_sign_in_as_googleapis_auth/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart b/packages/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart index 369135371ed3..8e982ace225f 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart +++ b/packages/extension_google_sign_in_as_googleapis_auth/example/lib/main.dart @@ -4,9 +4,7 @@ import 'dart:async'; -// #docregion Import import 'package:extension_google_sign_in_as_googleapis_auth/extension_google_sign_in_as_googleapis_auth.dart'; -// #enddocregion Import import 'package:flutter/material.dart'; import 'package:google_sign_in/google_sign_in.dart'; import 'package:googleapis/people/v1.dart'; @@ -60,7 +58,6 @@ class SignInDemoState extends State { _contactText = 'Loading contact info...'; }); -// #docregion CreateAPIClient // Retrieve an [auth.AuthClient] from the current [GoogleSignIn] instance. final auth.AuthClient? client = await _googleSignIn.authenticatedClient(); @@ -74,7 +71,6 @@ class SignInDemoState extends State { 'people/me', personFields: 'names', ); - // #enddocregion CreateAPIClient final String? firstNamedContactName = _pickFirstNamedContact(response.connections); diff --git a/packages/extension_google_sign_in_as_googleapis_auth/pubspec.yaml b/packages/extension_google_sign_in_as_googleapis_auth/pubspec.yaml index 3adbd9677446..4d5e1a06b3fe 100644 --- a/packages/extension_google_sign_in_as_googleapis_auth/pubspec.yaml +++ b/packages/extension_google_sign_in_as_googleapis_auth/pubspec.yaml @@ -8,7 +8,7 @@ name: extension_google_sign_in_as_googleapis_auth description: A bridge package between google_sign_in and googleapis_auth, to create Authenticated Clients from google_sign_in user credentials. repository: https://github.com/flutter/packages/tree/main/packages/extension_google_sign_in_as_googleapis_auth issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+extension_google_sign_in_as_googleapis_auth%22 -version: 2.0.12 +version: 2.0.11 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/file_selector/file_selector/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/file_selector/file_selector/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..3c472b99c6f3 100644 --- a/packages/file_selector/file_selector/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/file_selector/file_selector/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/file_selector/file_selector_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/file_selector/file_selector_android/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..3c472b99c6f3 100644 --- a/packages/file_selector/file_selector_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/file_selector/file_selector_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/file_selector/file_selector_android/pubspec.yaml b/packages/file_selector/file_selector_android/pubspec.yaml index 4ec709cfa356..09e60ee22e58 100644 --- a/packages/file_selector/file_selector_android/pubspec.yaml +++ b/packages/file_selector/file_selector_android/pubspec.yaml @@ -27,7 +27,7 @@ dev_dependencies: build_runner: ^2.1.4 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^9.2.4 topics: diff --git a/packages/file_selector/file_selector_android/test/file_selector_android_test.mocks.dart b/packages/file_selector/file_selector_android/test/file_selector_android_test.mocks.dart index 5d0e3c2250f5..63a62f6b94b3 100644 --- a/packages/file_selector/file_selector_android/test/file_selector_android_test.mocks.dart +++ b/packages/file_selector/file_selector_android/test/file_selector_android_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in file_selector_android/test/file_selector_android_test.dart. // Do not manually edit this file. @@ -12,8 +12,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -44,7 +42,6 @@ class MockFileSelectorApi extends _i1.Mock implements _i2.FileSelectorApi { ), returnValue: _i3.Future<_i2.FileResponse?>.value(), ) as _i3.Future<_i2.FileResponse?>); - @override _i3.Future> openFiles( String? arg_initialDirectory, @@ -61,7 +58,6 @@ class MockFileSelectorApi extends _i1.Mock implements _i2.FileSelectorApi { returnValue: _i3.Future>.value(<_i2.FileResponse?>[]), ) as _i3.Future>); - @override _i3.Future getDirectoryPath(String? arg_initialDirectory) => (super.noSuchMethod( diff --git a/packages/file_selector/file_selector_ios/pubspec.yaml b/packages/file_selector/file_selector_ios/pubspec.yaml index c0c1337ff2a3..c9c7ce245f28 100644 --- a/packages/file_selector/file_selector_ios/pubspec.yaml +++ b/packages/file_selector/file_selector_ios/pubspec.yaml @@ -25,7 +25,7 @@ dev_dependencies: build_runner: ^2.3.0 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^13.0.0 topics: diff --git a/packages/file_selector/file_selector_ios/test/file_selector_ios_test.mocks.dart b/packages/file_selector/file_selector_ios/test/file_selector_ios_test.mocks.dart index 0644c66f6732..c4186b0c6012 100644 --- a/packages/file_selector/file_selector_ios/test/file_selector_ios_test.mocks.dart +++ b/packages/file_selector/file_selector_ios/test/file_selector_ios_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in file_selector_ios/test/file_selector_ios_test.dart. // Do not manually edit this file. @@ -14,8 +14,6 @@ import 'test_api.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/file_selector/file_selector_macos/example/lib/get_multiple_directories_page.dart b/packages/file_selector/file_selector_macos/example/lib/get_multiple_directories_page.dart index ebe1f2ac8259..c5fcecec7c77 100644 --- a/packages/file_selector/file_selector_macos/example/lib/get_multiple_directories_page.dart +++ b/packages/file_selector/file_selector_macos/example/lib/get_multiple_directories_page.dart @@ -42,8 +42,10 @@ class GetMultipleDirectoriesPage extends StatelessWidget { children: [ ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: Colors.blue, - foregroundColor: Colors.white, + // ignore: deprecated_member_use + primary: Colors.blue, + // ignore: deprecated_member_use + onPrimary: Colors.white, ), child: const Text( 'Press to ask user to choose multiple directories'), diff --git a/packages/file_selector/file_selector_macos/pubspec.yaml b/packages/file_selector/file_selector_macos/pubspec.yaml index 10d487058c51..e0fc2dbbf2a9 100644 --- a/packages/file_selector/file_selector_macos/pubspec.yaml +++ b/packages/file_selector/file_selector_macos/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: build_runner: ^2.3.2 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^10.1.3 topics: diff --git a/packages/file_selector/file_selector_macos/test/file_selector_macos_test.mocks.dart b/packages/file_selector/file_selector_macos/test/file_selector_macos_test.mocks.dart index 333fc8f2936e..ff16017bd5df 100644 --- a/packages/file_selector/file_selector_macos/test/file_selector_macos_test.mocks.dart +++ b/packages/file_selector/file_selector_macos/test/file_selector_macos_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in file_selector_macos/test/file_selector_macos_test.dart. // Do not manually edit this file. @@ -14,8 +14,6 @@ import 'messages_test.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -41,7 +39,6 @@ class MockTestFileSelectorApi extends _i1.Mock ), returnValue: _i3.Future>.value([]), ) as _i3.Future>); - @override _i3.Future displaySavePanel(_i4.SavePanelOptions? options) => (super.noSuchMethod( diff --git a/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart b/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart index 1cec6fc7ad10..09b15c2f0d7e 100644 --- a/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart +++ b/packages/file_selector/file_selector_web/example/integration_test/dom_helper_test.dart @@ -47,11 +47,7 @@ void main() { group('getFiles', () { final File mockFile1 = - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types File(['123456'].jsify as JSArray, 'file1.txt'); - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types final File mockFile2 = File([].jsify as JSArray, 'file2.txt'); testWidgets('works', (_) async { diff --git a/packages/file_selector/file_selector_windows/example/lib/get_multiple_directories_page.dart b/packages/file_selector/file_selector_windows/example/lib/get_multiple_directories_page.dart index ebe1f2ac8259..c5fcecec7c77 100644 --- a/packages/file_selector/file_selector_windows/example/lib/get_multiple_directories_page.dart +++ b/packages/file_selector/file_selector_windows/example/lib/get_multiple_directories_page.dart @@ -42,8 +42,10 @@ class GetMultipleDirectoriesPage extends StatelessWidget { children: [ ElevatedButton( style: ElevatedButton.styleFrom( - backgroundColor: Colors.blue, - foregroundColor: Colors.white, + // ignore: deprecated_member_use + primary: Colors.blue, + // ignore: deprecated_member_use + onPrimary: Colors.white, ), child: const Text( 'Press to ask user to choose multiple directories'), diff --git a/packages/file_selector/file_selector_windows/pubspec.yaml b/packages/file_selector/file_selector_windows/pubspec.yaml index 08cee1a35e95..b94015a17641 100644 --- a/packages/file_selector/file_selector_windows/pubspec.yaml +++ b/packages/file_selector/file_selector_windows/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: build_runner: ^2.3.0 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^10.0.0 topics: diff --git a/packages/file_selector/file_selector_windows/test/file_selector_windows_test.mocks.dart b/packages/file_selector/file_selector_windows/test/file_selector_windows_test.mocks.dart index 3d31e335d2b4..7168e0c8d816 100644 --- a/packages/file_selector/file_selector_windows/test/file_selector_windows_test.mocks.dart +++ b/packages/file_selector/file_selector_windows/test/file_selector_windows_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in file_selector_windows/test/file_selector_windows_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:file_selector_windows/src/messages.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; @@ -12,8 +14,6 @@ import 'test_api.g.dart' as _i3; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -68,7 +68,6 @@ class MockTestFileSelectorApi extends _i1.Mock ), ), ) as _i2.FileDialogResult); - @override _i2.FileDialogResult showSaveDialog( _i2.SelectionOptions? options, diff --git a/packages/flutter_adaptive_scaffold/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/flutter_adaptive_scaffold/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/flutter_adaptive_scaffold/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/flutter_adaptive_scaffold/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/flutter_image/CHANGELOG.md b/packages/flutter_image/CHANGELOG.md index 987e7a5bb29f..d3a8cbc41ce7 100644 --- a/packages/flutter_image/CHANGELOG.md +++ b/packages/flutter_image/CHANGELOG.md @@ -1,8 +1,6 @@ -## 4.1.10 +## NEXT -* Fixes image asset link to use image within package. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Updates README to improve example of using `NetworkImageWithRetry`. ## 4.1.9 diff --git a/packages/flutter_image/README.md b/packages/flutter_image/README.md index 11529c146883..f31adcd98f76 100644 --- a/packages/flutter_image/README.md +++ b/packages/flutter_image/README.md @@ -7,10 +7,9 @@ network with a retry mechanism. Example: - ```dart -const Image avatar = Image( - image: NetworkImageWithRetry('http://example.com/avatars/123.jpg'), +var avatar = new Image( + image: new NetworkImageWithRetry('http://example.com/avatars/123.jpg'), ); ``` diff --git a/packages/flutter_image/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/flutter_image/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..3c472b99c6f3 100644 --- a/packages/flutter_image/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/flutter_image/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/flutter_image/example/lib/main.dart b/packages/flutter_image/example/lib/main.dart index 41745a689c56..86e5ae1c160a 100644 --- a/packages/flutter_image/example/lib/main.dart +++ b/packages/flutter_image/example/lib/main.dart @@ -13,14 +13,14 @@ class MyApp extends StatelessWidget { const MyApp({super.key}); /// Returns the URL to load an asset from this example app as a network source. - String getUrlForAssetAsNetworkSource(String assetKey) { - return 'https://github.com/flutter/packages/blob/b96a6dae0ca418cf1e91633f275866aa9cffe437/packages/flutter_image/example/$assetKey?raw=true'; + // TODO(nitinpoojary): Change it to use an image within this package. + String getUrlFromAssetAsNetworkSource() { + return 'https://github.com/flutter/packages/blob/2e1673307ff7454aff40b47024eaed49a9e77e81/packages/flutter_markdown/example/assets/logo.png'; } @override Widget build(BuildContext context) { - final String imageUrl = - getUrlForAssetAsNetworkSource('assets/flutter-mark-square-64.png'); + final String imageUrl = getUrlFromAssetAsNetworkSource(); return MaterialApp( title: 'flutter_image example app', diff --git a/packages/flutter_image/example/lib/readme_excerpts.dart b/packages/flutter_image/example/lib/readme_excerpts.dart deleted file mode 100644 index 226fe91fdd2a..000000000000 --- a/packages/flutter_image/example/lib/readme_excerpts.dart +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/widgets.dart'; -import 'package:flutter_image/flutter_image.dart'; - -/// Demonstrates loading an image for the README. -Image networkImageWithRetry() { -// #docregion NetworkImageWithRetry - const Image avatar = Image( - image: NetworkImageWithRetry('http://example.com/avatars/123.jpg'), - ); -// #enddocregion NetworkImageWithRetry - - return avatar; -} diff --git a/packages/flutter_image/example/test/readme_excerpts_test.dart b/packages/flutter_image/example/test/readme_excerpts_test.dart deleted file mode 100644 index 92365379e393..000000000000 --- a/packages/flutter_image/example/test/readme_excerpts_test.dart +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/widgets.dart'; -import 'package:flutter_image/flutter_image.dart'; -import 'package:flutter_image_example/readme_excerpts.dart'; -import 'package:flutter_test/flutter_test.dart'; - -void main() { - test('networkImageWithRetry returns an Image with NetworkImageWithRetry', () { - // Ensure that the snippet code runs successfully. - final Image result = networkImageWithRetry(); - - // It should have a image property of the right type. - expect(result.image, isInstanceOf()); - // And the NetworkImageWithRetry should have a url property. - final NetworkImageWithRetry networkImage = - result.image as NetworkImageWithRetry; - expect(networkImage.url, equals('http://example.com/avatars/123.jpg')); - }); -} diff --git a/packages/flutter_image/pubspec.yaml b/packages/flutter_image/pubspec.yaml index 483576343d1d..538d4a416838 100644 --- a/packages/flutter_image/pubspec.yaml +++ b/packages/flutter_image/pubspec.yaml @@ -3,7 +3,7 @@ description: > Image utilities for Flutter: improved network providers, effects, etc. repository: https://github.com/flutter/packages/tree/main/packages/flutter_image issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+flutter_image%22 -version: 4.1.10 +version: 4.1.9 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/flutter_markdown/CHANGELOG.md b/packages/flutter_markdown/CHANGELOG.md index f867f2d297d8..72f12ab11adb 100644 --- a/packages/flutter_markdown/CHANGELOG.md +++ b/packages/flutter_markdown/CHANGELOG.md @@ -1,7 +1,6 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Fixes lint warnings. ## 0.6.18+2 diff --git a/packages/flutter_markdown/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/flutter_markdown/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/flutter_markdown/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/flutter_markdown/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/flutter_markdown/lib/src/builder.dart b/packages/flutter_markdown/lib/src/builder.dart index 8ffac7a33f44..0ab3346d3376 100644 --- a/packages/flutter_markdown/lib/src/builder.dart +++ b/packages/flutter_markdown/lib/src/builder.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// ignore: unnecessary_import, see https://github.com/flutter/flutter/pull/138881 import 'dart:ui'; import 'package:flutter/gestures.dart'; diff --git a/packages/flutter_markdown/pubspec.yaml b/packages/flutter_markdown/pubspec.yaml index 52e17f99e7e1..cb14d71d16a7 100644 --- a/packages/flutter_markdown/pubspec.yaml +++ b/packages/flutter_markdown/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 standard_message_codec: ^0.0.1+3 topics: diff --git a/packages/flutter_plugin_android_lifecycle/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/flutter_plugin_android_lifecycle/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/flutter_plugin_android_lifecycle/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/flutter_plugin_android_lifecycle/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/go_router/CHANGELOG.md b/packages/go_router/CHANGELOG.md index d7d52ddf96cc..b62f174d7fbe 100644 --- a/packages/go_router/CHANGELOG.md +++ b/packages/go_router/CHANGELOG.md @@ -1,7 +1,3 @@ -## 12.1.3 - -* Fixes a typo in `navigation.md`. - ## 12.1.2 * Fixes an incorrect use of `extends` for Dart 3 compatibility. diff --git a/packages/go_router/doc/navigation.md b/packages/go_router/doc/navigation.md index b0ad5249f80e..f351d2b821d4 100644 --- a/packages/go_router/doc/navigation.md +++ b/packages/go_router/doc/navigation.md @@ -88,7 +88,7 @@ onTap: () => context.pop(true) You can provide additional data along with navigation. ```dart -context.go('/123', extra: 'abc'); +context.go('/123, extra: 'abc'); ``` and retrieve the data from GoRouterState diff --git a/packages/go_router/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/go_router/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/go_router/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/go_router/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/go_router/example/lib/extra_codec.dart b/packages/go_router/example/lib/extra_codec.dart index f7ae2a4f576c..497312cb5303 100644 --- a/packages/go_router/example/lib/extra_codec.dart +++ b/packages/go_router/example/lib/extra_codec.dart @@ -116,7 +116,7 @@ class _MyExtraDecoder extends Converter { if (inputAsList[0] == 'ComplexData2') { return ComplexData2(inputAsList[1]! as String); } - throw FormatException('Unable to parse input: $input'); + throw FormatException('Unable tp parse input: $input'); } } diff --git a/packages/go_router/example/test/extra_codec_test.dart b/packages/go_router/example/test/extra_codec_test.dart index e42b19ddb3b3..7358cfc614ed 100644 --- a/packages/go_router/example/test/extra_codec_test.dart +++ b/packages/go_router/example/test/extra_codec_test.dart @@ -20,20 +20,4 @@ void main() { expect(find.text('The extra for this page is: ComplexData2(data: data)'), findsOneWidget); }); - - test('invalid extra throws', () { - const example.MyExtraCodec extraCodec = example.MyExtraCodec(); - const List invalidValue = ['invalid']; - - expect( - () => extraCodec.decode(invalidValue), - throwsA( - predicate( - (Object? exception) => - exception is FormatException && - exception.message == 'Unable to parse input: $invalidValue', - ), - ), - ); - }); } diff --git a/packages/go_router/pubspec.yaml b/packages/go_router/pubspec.yaml index 42e8e8e7ba62..b0360ff6011d 100644 --- a/packages/go_router/pubspec.yaml +++ b/packages/go_router/pubspec.yaml @@ -1,7 +1,7 @@ name: go_router description: A declarative router for Flutter based on Navigation 2 supporting deep linking, data-driven routes and more -version: 12.1.3 +version: 12.1.2 repository: https://github.com/flutter/packages/tree/main/packages/go_router issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router%22 diff --git a/packages/go_router_builder/CHANGELOG.md b/packages/go_router_builder/CHANGELOG.md index 153978168be4..55c0a50f150e 100644 --- a/packages/go_router_builder/CHANGELOG.md +++ b/packages/go_router_builder/CHANGELOG.md @@ -1,6 +1,5 @@ -## 2.4.0 +## NEXT -* Adds support for passing observers to the ShellRoute for the nested Navigator. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 2.3.4 diff --git a/packages/go_router_builder/example/lib/shell_route_with_observers_example.dart b/packages/go_router_builder/example/lib/shell_route_with_observers_example.dart deleted file mode 100644 index b644ee3bb02a..000000000000 --- a/packages/go_router_builder/example/lib/shell_route_with_observers_example.dart +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// ignore_for_file: public_member_api_docs - -import 'package:flutter/material.dart'; -import 'package:go_router/go_router.dart'; - -part 'shell_route_with_observers_example.g.dart'; - -void main() => runApp(App()); - -class App extends StatelessWidget { - App({super.key}); - - @override - Widget build(BuildContext context) => MaterialApp.router( - routerConfig: _router, - ); - - final GoRouter _router = GoRouter( - routes: $appRoutes, - initialLocation: '/home', - ); -} - -@TypedShellRoute( - routes: >[ - TypedGoRoute(path: '/home'), - TypedGoRoute( - path: '/users', - routes: >[ - TypedGoRoute(path: ':id'), - ], - ), - ], -) -class MyShellRouteData extends ShellRouteData { - const MyShellRouteData(); - - static final List $observers = [ - MyNavigatorObserver() - ]; - - @override - Widget builder(BuildContext context, GoRouterState state, Widget navigator) { - return MyShellRouteScreen(child: navigator); - } -} - -class MyNavigatorObserver extends NavigatorObserver { - @override - void didPush(Route route, Route? previousRoute) {} -} - -class MyShellRouteScreen extends StatelessWidget { - const MyShellRouteScreen({required this.child, super.key}); - - final Widget child; - - int getCurrentIndex(BuildContext context) { - final String location = GoRouterState.of(context).uri.toString(); - if (location.startsWith('/users')) { - return 1; - } - return 0; - } - - @override - Widget build(BuildContext context) { - final int selectedIndex = getCurrentIndex(context); - - return Scaffold( - body: Row( - children: [ - NavigationRail( - destinations: const [ - NavigationRailDestination( - icon: Icon(Icons.home), - label: Text('Home'), - ), - NavigationRailDestination( - icon: Icon(Icons.group), - label: Text('Users'), - ), - ], - selectedIndex: selectedIndex, - onDestinationSelected: (int index) { - switch (index) { - case 0: - const HomeRouteData().go(context); - break; - case 1: - const UsersRouteData().go(context); - break; - } - }, - ), - const VerticalDivider(thickness: 1, width: 1), - Expanded(child: child), - ], - ), - ); - } -} - -class HomeRouteData extends GoRouteData { - const HomeRouteData(); - - @override - Widget build(BuildContext context, GoRouterState state) { - return const Center(child: Text('The home page')); - } -} - -class UsersRouteData extends GoRouteData { - const UsersRouteData(); - - @override - Widget build(BuildContext context, GoRouterState state) { - return ListView( - children: [ - for (int userID = 1; userID <= 3; userID++) - ListTile( - title: Text('User $userID'), - onTap: () => UserRouteData(id: userID).go(context), - ), - ], - ); - } -} - -class DialogPage extends Page { - /// A page to display a dialog. - const DialogPage({required this.child, super.key}); - - /// The widget to be displayed which is usually a [Dialog] widget. - final Widget child; - - @override - Route createRoute(BuildContext context) { - return DialogRoute( - context: context, - settings: this, - builder: (BuildContext context) => child, - ); - } -} - -class UserRouteData extends GoRouteData { - const UserRouteData({required this.id}); - - // Without this static key, the dialog will not cover the navigation rail. - final int id; - - @override - Page buildPage(BuildContext context, GoRouterState state) { - return DialogPage( - key: state.pageKey, - child: Center( - child: SizedBox( - width: 300, - height: 300, - child: Card(child: Center(child: Text('User $id'))), - ), - ), - ); - } -} diff --git a/packages/go_router_builder/example/lib/shell_route_with_observers_example.g.dart b/packages/go_router_builder/example/lib/shell_route_with_observers_example.g.dart deleted file mode 100644 index 5737eb472a33..000000000000 --- a/packages/go_router_builder/example/lib/shell_route_with_observers_example.g.dart +++ /dev/null @@ -1,93 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -// ignore_for_file: always_specify_types, public_member_api_docs - -part of 'shell_route_with_observers_example.dart'; - -// ************************************************************************** -// GoRouterGenerator -// ************************************************************************** - -List get $appRoutes => [ - $myShellRouteData, - ]; - -RouteBase get $myShellRouteData => ShellRouteData.$route( - observers: MyShellRouteData.$observers, - factory: $MyShellRouteDataExtension._fromState, - routes: [ - GoRouteData.$route( - path: '/home', - factory: $HomeRouteDataExtension._fromState, - ), - GoRouteData.$route( - path: '/users', - factory: $UsersRouteDataExtension._fromState, - routes: [ - GoRouteData.$route( - path: ':id', - factory: $UserRouteDataExtension._fromState, - ), - ], - ), - ], - ); - -extension $MyShellRouteDataExtension on MyShellRouteData { - static MyShellRouteData _fromState(GoRouterState state) => - const MyShellRouteData(); -} - -extension $HomeRouteDataExtension on HomeRouteData { - static HomeRouteData _fromState(GoRouterState state) => const HomeRouteData(); - - String get location => GoRouteData.$location( - '/home', - ); - - void go(BuildContext context) => context.go(location); - - Future push(BuildContext context) => context.push(location); - - void pushReplacement(BuildContext context) => - context.pushReplacement(location); - - void replace(BuildContext context) => context.replace(location); -} - -extension $UsersRouteDataExtension on UsersRouteData { - static UsersRouteData _fromState(GoRouterState state) => - const UsersRouteData(); - - String get location => GoRouteData.$location( - '/users', - ); - - void go(BuildContext context) => context.go(location); - - Future push(BuildContext context) => context.push(location); - - void pushReplacement(BuildContext context) => - context.pushReplacement(location); - - void replace(BuildContext context) => context.replace(location); -} - -extension $UserRouteDataExtension on UserRouteData { - static UserRouteData _fromState(GoRouterState state) => UserRouteData( - id: int.parse(state.pathParameters['id']!), - ); - - String get location => GoRouteData.$location( - '/users/${Uri.encodeComponent(id.toString())}', - ); - - void go(BuildContext context) => context.go(location); - - Future push(BuildContext context) => context.push(location); - - void pushReplacement(BuildContext context) => - context.pushReplacement(location); - - void replace(BuildContext context) => context.replace(location); -} diff --git a/packages/go_router_builder/lib/src/route_config.dart b/packages/go_router_builder/lib/src/route_config.dart index b358d7809d10..d2ff611961e5 100644 --- a/packages/go_router_builder/lib/src/route_config.dart +++ b/packages/go_router_builder/lib/src/route_config.dart @@ -40,7 +40,6 @@ class ShellRouteConfig extends RouteBaseConfig { required this.navigatorKey, required this.parentNavigatorKey, required super.routeDataClass, - required this.observers, required super.parent, }) : super._(); @@ -50,9 +49,6 @@ class ShellRouteConfig extends RouteBaseConfig { /// The parent navigator key. final String? parentNavigatorKey; - /// The navigator observers. - final String? observers; - @override Iterable classDeclarations() { if (routeDataClass.unnamedConstructor == null) { @@ -76,8 +72,7 @@ class ShellRouteConfig extends RouteBaseConfig { @override String get routeConstructorParameters => '${navigatorKey == null ? '' : 'navigatorKey: $navigatorKey,'}' - '${parentNavigatorKey == null ? '' : 'parentNavigatorKey: $parentNavigatorKey,'}' - '${observers == null ? '' : 'observers: $observers,'}'; + '${parentNavigatorKey == null ? '' : 'parentNavigatorKey: $parentNavigatorKey,'}'; @override String get factorConstructorParameters => @@ -480,10 +475,6 @@ abstract class RouteBaseConfig { classElement, parameterName: r'$parentNavigatorKey', ), - observers: _generateParameterGetterCode( - classElement, - parameterName: r'$observers', - ), ); break; case 'TypedStatefulShellRoute': @@ -577,9 +568,7 @@ abstract class RouteBaseConfig { if (!element.isStatic || element.name != parameterName) { return false; } - if (parameterName - .toLowerCase() - .contains(RegExp('navigatorKey | observers'))) { + if (parameterName.toLowerCase().contains('navigatorkey')) { final DartType type = element.type; if (type is! ParameterizedType) { return false; @@ -602,6 +591,7 @@ abstract class RouteBaseConfig { if (fieldDisplayName != null) { return '${classElement.name}.$fieldDisplayName'; } + final String? methodDisplayName = classElement.methods .where((MethodElement element) { return element.isStatic && element.name == parameterName; diff --git a/packages/go_router_builder/pubspec.yaml b/packages/go_router_builder/pubspec.yaml index 0c4e2f158e39..4d3d1bba597a 100644 --- a/packages/go_router_builder/pubspec.yaml +++ b/packages/go_router_builder/pubspec.yaml @@ -2,7 +2,7 @@ name: go_router_builder description: >- A builder that supports generated strongly-typed route helpers for package:go_router -version: 2.4.0 +version: 2.3.4 repository: https://github.com/flutter/packages/tree/main/packages/go_router_builder issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+go_router_builder%22 diff --git a/packages/google_identity_services_web/CHANGELOG.md b/packages/google_identity_services_web/CHANGELOG.md index 92c96c07bdce..4079f59280c2 100644 --- a/packages/google_identity_services_web/CHANGELOG.md +++ b/packages/google_identity_services_web/CHANGELOG.md @@ -1,48 +1,6 @@ -## 0.3.0+2 +## NEXT -* Adds `fedcm_auto` to `CredentialSelectBy` enum. -* Adds `unknown_reason` to all `Moment*Reason` enums. - -## 0.3.0+1 - -* Corrects 0.3.0 changelog entry about the minimum Flutter/Dart dependencies. - -## 0.3.0 - -* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. -* Migrates from `package:js`/`dart:html` to `package:web` so this package can - compile to WASM. -* Performs the following **breaking API changes (in bold)** and other fixes to - align with the published GIS SDK: - * **Removes the need to explicitly `allowInterop` in all callbacks.** - * `id`: - * **Changes type:** - * `IdConfiguration.intermediate_iframe_close_callback` to - `VoidFn?`. - * Adds: `fedcm` to `CredentialSelectBy` enum. - * Fixes typo in `storeCredential` `callback` positional parameter name. - * `oauth2`: - * **Removes:** - * `CodeClientConfig.auto_select`, `hint` (now `login_hint`), and `hosted_domain` (now `hd`). - * `TokenClientConfig.hint` (now `login_hint`) and `hosted_domain` (now `hd`). - * `OverridableTokenClientConfig.hint` (now `login_hint`). - * **Changes types:** - * `CodeClientConfig.redirect_uri` to `Uri?`. - * `scope` in `CodeClientConfig` and `CodeResponse` to `List`. - * `CodeResponse.code` and `state` to `String?` (now nullable). - * `scope` in `TokenClientConfig`, `OverridableTokenClientConfig`, and `TokenResponse` to `List`. - * The following `TokenResponse` getters are now nullable: `access_token`, - `expires_in`, `hd`, `prompt`, `token_type`, and `state`. - * The `error_callback` functions now receive a `GoogleIdentityServicesError` parameter, instead of `Object`. - * Adds: - * `include_granted_scopes` and `enable_granular_consent` to `CodeClientConfig`. - * `include_granted_scopes` and `enable_granular_consent` to `TokenClientConfig`. - * `enable_granular_consent` to `OverridableTokenClientConfig`. - * `message` to `GoogleIdentityServicesError`. - * Fixes: - * Assert that `scope` is not empty when used to create `CodeClientConfig`, - `TokenClientConfig`, and `OverridableTokenClientConfig` instances. - * Deprecated `enable_serial_consent`. +* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 0.2.2 diff --git a/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart b/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart index 77914b746740..b7e911f60fae 100644 --- a/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart +++ b/packages/google_identity_services_web/example/integration_test/js_interop_id_test.dart @@ -2,17 +2,15 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// the following ignore is needed for downgraded analyzer (casts to JSObject). -// ignore_for_file: unnecessary_cast - import 'dart:async'; -import 'dart:js_interop'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_identity_services_web/id.dart'; import 'package:integration_test/integration_test.dart'; -import 'package:web/web.dart' as web; +import 'package:js/js.dart'; +import 'package:js/js_util.dart' as js_util show getProperty; +import 'src/dom.dart'; import 'utils.dart' as utils; void main() async { @@ -25,12 +23,11 @@ void main() async { group('renderButton', () { testWidgets('supports a js-interop target from any library', (_) async { - final web.HTMLDivElement target = - web.document.createElement('div') as web.HTMLDivElement; + final DomElement target = createDomElement('div'); id.renderButton(target); - final web.Element? button = target.querySelector('button'); + final DomElement? button = target.querySelector('button'); expect(button, isNotNull); }); }); @@ -40,9 +37,9 @@ void main() async { final IdConfiguration config = IdConfiguration( client_id: 'testing_1-2-3', auto_select: false, - callback: (_) {}, + callback: allowInterop((_) {}), login_uri: Uri.parse('https://www.example.com/login'), - native_callback: (_) {}, + native_callback: allowInterop((_) {}), cancel_on_tap_outside: false, prompt_parent_id: 'some_dom_id', nonce: 's0m3_r4ndOM_vALu3', @@ -50,38 +47,35 @@ void main() async { state_cookie_domain: 'subdomain.example.com', ux_mode: UxMode.popup, allowed_parent_origin: ['allowed', 'another'], - intermediate_iframe_close_callback: () {}, + intermediate_iframe_close_callback: allowInterop((_) {}), itp_support: true, login_hint: 'login-hint@example.com', hd: 'hd_value', use_fedcm_for_prompt: true, ); - final utils.ExpectConfigValueFn expectConfigValue = - utils.createExpectConfigValue(config as JSObject); + // Save some keystrokes below by partially applying to the 'config' above. + void expectConfigValue(String name, Object? matcher) { + expect(js_util.getProperty(config, name), matcher, reason: name); + } - expectConfigValue('client_id', 'testing_1-2-3'); + expectConfigValue('allowed_parent_origin', hasLength(2)); expectConfigValue('auto_select', isFalse); - expectConfigValue('callback', utils.isAJs('function')); - expectConfigValue('login_uri', 'https://www.example.com/login'); - expectConfigValue('native_callback', utils.isAJs('function')); + expectConfigValue('callback', isA()); expectConfigValue('cancel_on_tap_outside', isFalse); - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - expectConfigValue('allowed_parent_origin', isA()); - expectConfigValue('prompt_parent_id', 'some_dom_id'); - expectConfigValue('nonce', 's0m3_r4ndOM_vALu3'); - expectConfigValue('context', 'signin'); - expectConfigValue('state_cookie_domain', 'subdomain.example.com'); - expectConfigValue('ux_mode', 'popup'); - expectConfigValue( - 'allowed_parent_origin', ['allowed', 'another']); - expectConfigValue( - 'intermediate_iframe_close_callback', utils.isAJs('function')); + expectConfigValue('client_id', 'testing_1-2-3'); + expectConfigValue('context', isA()); + expectConfigValue('hd', 'hd_value'); + expectConfigValue('intermediate_iframe_close_callback', isA()); expectConfigValue('itp_support', isTrue); expectConfigValue('login_hint', 'login-hint@example.com'); - expectConfigValue('hd', 'hd_value'); + expectConfigValue('login_uri', isA()); + expectConfigValue('native_callback', isA()); + expectConfigValue('nonce', 's0m3_r4ndOM_vALu3'); + expectConfigValue('prompt_parent_id', 'some_dom_id'); + expectConfigValue('state_cookie_domain', 'subdomain.example.com'); expectConfigValue('use_fedcm_for_prompt', isTrue); + expectConfigValue('ux_mode', isA()); }); }); @@ -92,7 +86,7 @@ void main() async { final StreamController controller = StreamController(); - id.prompt(controller.add); + id.prompt(allowInterop(controller.add)); final PromptMomentNotification moment = await controller.stream.first; @@ -110,7 +104,7 @@ void main() async { id.initialize(IdConfiguration( client_id: 'testing_1-2-3', - callback: controller.add, + callback: allowInterop(controller.add), )); id.prompt(); diff --git a/packages/google_identity_services_web/example/integration_test/js_interop_oauth_test.dart b/packages/google_identity_services_web/example/integration_test/js_interop_oauth_test.dart index c197b1116dc6..50a06676e485 100644 --- a/packages/google_identity_services_web/example/integration_test/js_interop_oauth_test.dart +++ b/packages/google_identity_services_web/example/integration_test/js_interop_oauth_test.dart @@ -2,15 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// the following ignore is needed for downgraded analyzer (casts to JSObject). -// ignore_for_file: unnecessary_cast - import 'dart:async'; -import 'dart:js_interop'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_identity_services_web/oauth2.dart'; import 'package:integration_test/integration_test.dart'; +import 'package:js/js.dart'; import 'utils.dart' as utils; @@ -22,96 +19,12 @@ void main() async { await utils.installGisMock(); }); - group('Config objects pass values from Dart to JS - ', () { - testWidgets('TokenClientConfig', (_) async { - final TokenClientConfig config = TokenClientConfig( - client_id: 'testing_1-2-3', - callback: (_) {}, - scope: ['one', 'two', 'three'], - include_granted_scopes: true, - prompt: 'some-prompt', - enable_granular_consent: true, - login_hint: 'login-hint@example.com', - hd: 'hd_value', - state: 'some-state', - error_callback: (_) {}, - ); - - final utils.ExpectConfigValueFn expectConfigValue = - utils.createExpectConfigValue(config as JSObject); - - expectConfigValue('client_id', 'testing_1-2-3'); - expectConfigValue('callback', utils.isAJs('function')); - expectConfigValue('scope', 'one two three'); - expectConfigValue('include_granted_scopes', isTrue); - expectConfigValue('prompt', 'some-prompt'); - expectConfigValue('enable_granular_consent', isTrue); - expectConfigValue('login_hint', 'login-hint@example.com'); - expectConfigValue('hd', 'hd_value'); - expectConfigValue('state', 'some-state'); - expectConfigValue('error_callback', utils.isAJs('function')); - }); - - testWidgets('OverridableTokenClientConfig', (_) async { - final OverridableTokenClientConfig config = OverridableTokenClientConfig( - scope: ['one', 'two', 'three'], - include_granted_scopes: true, - prompt: 'some-prompt', - enable_granular_consent: true, - login_hint: 'login-hint@example.com', - state: 'some-state', - ); - - final utils.ExpectConfigValueFn expectConfigValue = - utils.createExpectConfigValue(config as JSObject); - - expectConfigValue('scope', 'one two three'); - expectConfigValue('include_granted_scopes', isTrue); - expectConfigValue('prompt', 'some-prompt'); - expectConfigValue('enable_granular_consent', isTrue); - expectConfigValue('login_hint', 'login-hint@example.com'); - expectConfigValue('state', 'some-state'); - }); - - testWidgets('CodeClientConfig', (_) async { - final CodeClientConfig config = CodeClientConfig( - client_id: 'testing_1-2-3', - scope: ['one', 'two', 'three'], - include_granted_scopes: true, - redirect_uri: Uri.parse('https://www.example.com/login'), - callback: (_) {}, - state: 'some-state', - enable_granular_consent: true, - login_hint: 'login-hint@example.com', - hd: 'hd_value', - ux_mode: UxMode.popup, - select_account: true, - error_callback: (_) {}, - ); - - final utils.ExpectConfigValueFn expectConfigValue = - utils.createExpectConfigValue(config as JSObject); - - expectConfigValue('scope', 'one two three'); - expectConfigValue('include_granted_scopes', isTrue); - expectConfigValue('redirect_uri', 'https://www.example.com/login'); - expectConfigValue('callback', utils.isAJs('function')); - expectConfigValue('state', 'some-state'); - expectConfigValue('enable_granular_consent', isTrue); - expectConfigValue('login_hint', 'login-hint@example.com'); - expectConfigValue('hd', 'hd_value'); - expectConfigValue('ux_mode', 'popup'); - expectConfigValue('select_account', isTrue); - expectConfigValue('error_callback', utils.isAJs('function')); - }); - }); - group('initTokenClient', () { testWidgets('returns a tokenClient', (_) async { final TokenClient client = oauth2.initTokenClient(TokenClientConfig( client_id: 'for-tests', - callback: (_) {}, - scope: ['some_scope', 'for_tests', 'not_real'], + callback: null, + scope: 'some_scope for_tests not_real', )); expect(client, isNotNull); @@ -127,8 +40,8 @@ void main() async { final TokenClient client = oauth2.initTokenClient(TokenClientConfig( client_id: 'for-tests', - callback: controller.add, - scope: scopes, + callback: allowInterop(controller.add), + scope: scopes.join(' '), )); utils.setMockTokenResponse(client, 'some-non-null-auth-token-value'); @@ -139,7 +52,7 @@ void main() async { expect(response, isNotNull); expect(response.error, isNull); - expect(response.scope, scopes); + expect(response.scope, scopes.join(' ')); }); testWidgets('configuration can be overridden', (_) async { @@ -150,21 +63,21 @@ void main() async { final TokenClient client = oauth2.initTokenClient(TokenClientConfig( client_id: 'for-tests', - callback: controller.add, - scope: ['blank'], + callback: allowInterop(controller.add), + scope: 'blank', )); utils.setMockTokenResponse(client, 'some-non-null-auth-token-value'); client.requestAccessToken(OverridableTokenClientConfig( - scope: scopes, + scope: scopes.join(' '), )); final TokenResponse response = await controller.stream.first; expect(response, isNotNull); expect(response.error, isNull); - expect(response.scope, scopes); + expect(response.scope, scopes.join(' ')); }); }); diff --git a/packages/google_identity_services_web/example/integration_test/src/dom.dart b/packages/google_identity_services_web/example/integration_test/src/dom.dart new file mode 100644 index 000000000000..fb41b0a9b906 --- /dev/null +++ b/packages/google_identity_services_web/example/integration_test/src/dom.dart @@ -0,0 +1,31 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: public_member_api_docs + +import 'package:js/js.dart'; +import 'package:js/js_util.dart' as js_util; + +@JS() +@staticInterop +class DomDocument {} + +extension DomDocumentExtension on DomDocument { + DomElement createElement(String name, [Object? options]) => + js_util.callMethod(this, 'createElement', + [name, if (options != null) options]) as DomElement; +} + +@JS() +@staticInterop +class DomElement {} + +extension DomElementExtension on DomElement { + external DomElement? querySelector(String selector); +} + +@JS('document') +external DomDocument get domDocument; + +DomElement createDomElement(String tag) => domDocument.createElement(tag); diff --git a/packages/google_identity_services_web/example/integration_test/utils.dart b/packages/google_identity_services_web/example/integration_test/utils.dart index 2d5c3f3fab8c..889a0eee328e 100644 --- a/packages/google_identity_services_web/example/integration_test/utils.dart +++ b/packages/google_identity_services_web/example/integration_test/utils.dart @@ -2,53 +2,31 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// the following ignore is needed for downgraded analyzer (casts to JSObject). -// ignore_for_file: unnecessary_cast - import 'dart:async'; -import 'dart:js_interop'; -import 'dart:js_interop_unsafe'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:google_identity_services_web/id.dart'; import 'package:google_identity_services_web/oauth2.dart'; -import 'package:web/web.dart' as web; - -/// Function that lets us expect that a JSObject has a [name] property that matches [matcher]. -/// -/// Use [createExpectConfigValue] to create one of this functions associated with -/// a specific [JSObject]. -typedef ExpectConfigValueFn = void Function(String name, Object? matcher); - -/// Creates a [ExpectConfigValueFn] for the `config` [JSObject]. -ExpectConfigValueFn createExpectConfigValue(JSObject config) { - return (String name, Object? matcher) { - expect(config[name], matcher, reason: name); - }; -} +import 'package:google_identity_services_web/src/js_interop/dom.dart'; +import 'package:js/js.dart'; +import 'package:js/js_util.dart'; -/// A matcher that checks if: value typeof [thing] == true (in JS). -/// -/// See: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof -Matcher isAJs(String thing) => isA() - .having((JSAny? p0) => p0.typeofEquals(thing), 'typeof "$thing"', isTrue); +@JS('window') +external Object get domWindow; /// Installs mock-gis.js in the page. /// Returns a future that completes when the 'load' event of the script fires. Future installGisMock() { final Completer completer = Completer(); - - final web.HTMLScriptElement script = - web.document.createElement('script') as web.HTMLScriptElement; + final DomHtmlScriptElement script = + document.createElement('script') as DomHtmlScriptElement; script.src = 'mock-gis.js'; - script.type = 'module'; - script.addEventListener( - 'load', - (JSAny? _) { - completer.complete(); - }.toJS); - - web.document.head!.appendChild(script); + setProperty(script, 'type', 'module'); + callMethod(script, 'addEventListener', [ + 'load', + allowInterop((_) { + completer.complete(); + }) + ]); + document.head.appendChild(script); return completer.future; } @@ -58,47 +36,41 @@ Future fakeAuthZWithScopes(List scopes) { StreamController(); final TokenClient client = oauth2.initTokenClient(TokenClientConfig( client_id: 'for-tests', - callback: controller.add, - scope: scopes, + callback: allowInterop(controller.add), + scope: scopes.join(' '), )); setMockTokenResponse(client, 'some-non-null-auth-token-value'); client.requestAccessToken(); return controller.stream.first; } -/// Allows calling a `setMockTokenResponse` method (added by mock-gis.js) -extension on TokenClient { - external void setMockTokenResponse(JSString? token); -} - /// Sets a mock TokenResponse value in a [client]. void setMockTokenResponse(TokenClient client, [String? authToken]) { - client.setMockTokenResponse(authToken?.toJS); -} - -/// Allows calling a `setMockCredentialResponse` method (set by mock-gis.js) -extension on GoogleAccountsId { - external void setMockCredentialResponse( - JSString credential, - JSString select_by, //ignore: non_constant_identifier_names + callMethod( + client, + 'setMockTokenResponse', + [authToken], ); } /// Sets a mock credential response in `google.accounts.id`. void setMockCredentialResponse([String value = 'default_value']) { - _getGoogleAccountsId().setMockCredentialResponse(value.toJS, 'auto'.toJS); + callMethod( + _getGoogleAccountsId(), + 'setMockCredentialResponse', + [value, 'auto'], + ); } -GoogleAccountsId _getGoogleAccountsId() { - return _getDeepProperty( - web.window as JSObject, 'google.accounts.id'); +Object _getGoogleAccountsId() { + return _getDeepProperty(domWindow, 'google.accounts.id'); } // Attempts to retrieve a deeply nested property from a jsObject (or die tryin') -T _getDeepProperty(JSObject jsObject, String deepProperty) { +T _getDeepProperty(Object jsObject, String deepProperty) { final List properties = deepProperty.split('.'); - return properties.fold( + return properties.fold( jsObject, - (JSObject? jsObj, String prop) => jsObj?[prop] as JSObject?, + (Object jsObj, String prop) => getProperty(jsObj, prop), ) as T; } diff --git a/packages/google_identity_services_web/example/lib/main.dart b/packages/google_identity_services_web/example/lib/main.dart index a8f6239dbfff..a0b613ddb171 100644 --- a/packages/google_identity_services_web/example/lib/main.dart +++ b/packages/google_identity_services_web/example/lib/main.dart @@ -8,6 +8,7 @@ import 'package:google_identity_services_web/id.dart'; // #docregion use-loader import 'package:google_identity_services_web/loader.dart' as gis; // #enddocregion use-loader +import 'package:js/js.dart' show allowInterop; import 'src/jwt.dart' as jwt; @@ -19,13 +20,13 @@ void main() async { id.setLogLevel('debug'); final IdConfiguration config = IdConfiguration( - client_id: 'your-google-client-id-goes-here.apps.googleusercontent.com', - callback: onCredentialResponse, + client_id: 'your-client_id.apps.googleusercontent.com', + callback: allowInterop(onCredentialResponse), use_fedcm_for_prompt: true, ); id.initialize(config); - id.prompt(onPromptMoment); + id.prompt(allowInterop(onPromptMoment)); // #docregion use-loader } // #enddocregion use-loader diff --git a/packages/google_identity_services_web/example/lib/main_oauth.dart b/packages/google_identity_services_web/example/lib/main_oauth.dart index 05fed3ba5f49..c54ab4cc606f 100644 --- a/packages/google_identity_services_web/example/lib/main_oauth.dart +++ b/packages/google_identity_services_web/example/lib/main_oauth.dart @@ -10,6 +10,8 @@ import 'package:google_identity_services_web/id.dart'; import 'package:google_identity_services_web/loader.dart' as gis; import 'package:google_identity_services_web/oauth2.dart'; import 'package:http/http.dart' as http; +import 'package:js/js.dart' show allowInterop; +import 'package:js/js_util.dart' show getProperty; /// People API to return my profile info... const String MY_PROFILE = @@ -36,15 +38,15 @@ void main() async { id.setLogLevel('debug'); final TokenClientConfig config = TokenClientConfig( - client_id: 'your-google-client-id-goes-here.apps.googleusercontent.com', - scope: scopes, - callback: onTokenResponse, - error_callback: onError, + client_id: 'your-client_id.apps.googleusercontent.com', + scope: scopes.join(' '), + callback: allowInterop(onTokenResponse), + error_callback: allowInterop(onError), ); final OverridableTokenClientConfig overridableCfg = OverridableTokenClientConfig( - scope: scopes + myConnectionsScopes, + scope: (scopes + myConnectionsScopes).join(' '), ); final TokenClient client = oauth2.initTokenClient(config); @@ -57,8 +59,8 @@ void main() async { /// /// We cannot use the proper type for `error` here yet, because of: /// https://github.com/dart-lang/sdk/issues/50899 -Future onError(GoogleIdentityServicesError? error) async { - print('Error! ${error?.type} (${error?.message})'); +Future onError(Object? error) async { + print('Error! ${getProperty(error!, "type")}'); } /// Handles the returned (auth) token response. @@ -86,11 +88,12 @@ Future onTokenResponse(TokenResponse token) async { print(contacts); print('Revoking token...'); - oauth2.revoke(token.access_token!, (TokenRevocationResponse response) { + oauth2.revoke(token.access_token, + allowInterop((TokenRevocationResponse response) { print(response.successful); print(response.error); print(response.error_description); - }); + })); } /// Gets from [url] with an authorization header defined by [token]. diff --git a/packages/google_identity_services_web/example/pubspec.yaml b/packages/google_identity_services_web/example/pubspec.yaml index e53f85dff1cb..c2b0fd768726 100644 --- a/packages/google_identity_services_web/example/pubspec.yaml +++ b/packages/google_identity_services_web/example/pubspec.yaml @@ -4,8 +4,7 @@ publish_to: 'none' version: 0.0.1 environment: - flutter: ">=3.16.0" - sdk: ">=3.2.0 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: flutter: @@ -13,7 +12,7 @@ dependencies: google_identity_services_web: path: ../ http: ">=0.13.0 <2.0.0" - web: ">=0.3.0 <0.5.0" + js: ^0.6.4 dev_dependencies: build_runner: ^2.1.10 # To extract README excerpts only. diff --git a/packages/google_identity_services_web/lib/src/js_interop/dom.dart b/packages/google_identity_services_web/lib/src/js_interop/dom.dart new file mode 100644 index 000000000000..ff5dfc96a9ac --- /dev/null +++ b/packages/google_identity_services_web/lib/src/js_interop/dom.dart @@ -0,0 +1,187 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/* +// DOM shim. This file contains everything we need from the DOM API written as +// @staticInterop, so we don't need dart:html +// https://developer.mozilla.org/en-US/docs/Web/API/ +*/ + +import 'package:js/js.dart'; + +/// Document interface +@JS() +@staticInterop +@anonymous +abstract class DomHtmlDocument {} + +/// Some methods of document +extension DomHtmlDocumentExtension on DomHtmlDocument { + /// document.head + external DomHtmlElement get head; + + /// document.createElement + external DomHtmlElement createElement(String tagName); +} + +/// console interface +@JS() +@staticInterop +@anonymous +abstract class DomConsole {} + +/// The interface of window.console +extension DomConsoleExtension on DomConsole { + /// console.debug + external DomConsoleDumpFn get debug; + + /// console.info + external DomConsoleDumpFn get info; + + /// console.log + external DomConsoleDumpFn get log; + + /// console.warn + external DomConsoleDumpFn get warn; + + /// console.error + external DomConsoleDumpFn get error; +} + +/// Fakey variadic-type for console-dumping methods (like console.log or info). +typedef DomConsoleDumpFn = void Function( + Object? arg, [ + Object? arg2, + Object? arg3, + Object? arg4, + Object? arg5, + Object? arg6, + Object? arg7, + Object? arg8, + Object? arg9, + Object? arg10, +]); + +/// An instance of an HTMLElement +@JS() +@staticInterop +@anonymous +abstract class DomHtmlElement {} + +/// (Some) methods of HtmlElement +extension DomHtmlElementExtension on DomHtmlElement { + /// Node.appendChild + external DomHtmlElement appendChild(DomHtmlElement child); +} + +/// An instance of an HTMLScriptElement +@JS() +@staticInterop +@anonymous +abstract class DomHtmlScriptElement extends DomHtmlElement {} + +/// Some methods exclusive of Script elements +extension DomHtmlScriptElementExtension on DomHtmlScriptElement { + external set src(Object stringOrSafeScriptURL); + external set async(bool async); + external set defer(bool defer); +} + +/// Error object +@JS('Error') +@staticInterop +abstract class DomError {} + +/// Methods on the error object +extension DomErrorExtension on DomError { + /// Error message. + external String? get message; + + /// Stack trace. + external String? get stack; + + /// Error name. This is determined by the constructor function. + external String get name; + + /// Error cause indicating the reason why the current error is thrown. + /// + /// This is usually another caught error, or the value provided as the `cause` + /// property of the Error constructor's second argument. + external Object? get cause; +} + +/* +// Trusted Types API (TrustedTypePolicy, TrustedScript, TrustedScriptURL) +// https://developer.mozilla.org/en-US/docs/Web/API/TrustedTypesAPI +*/ + +/// A factory to create `TrustedTypePolicy` objects. +@JS() +@staticInterop +@anonymous +abstract class DomTrustedTypePolicyFactory {} + +/// (Some) methods of the [DomTrustedTypePolicyFactory]: +extension DomTrustedTypePolicyFactoryExtension on DomTrustedTypePolicyFactory { + /// createPolicy + external DomTrustedTypePolicy createPolicy( + String policyName, + DomTrustedTypePolicyOptions? policyOptions, + ); +} + +/// Options to create a trusted type policy. +@JS() +@staticInterop +@anonymous +abstract class DomTrustedTypePolicyOptions { + /// Constructs a TrustedPolicyOptions object in JavaScript. + /// + /// The following properties need to be manually wrapped in [allowInterop] + /// before being passed to this constructor: [createScriptURL]. + external factory DomTrustedTypePolicyOptions({ + DomCreateScriptUrlOptionFn? createScriptURL, + }); +} + +/// Type of the function to configure createScriptURL +typedef DomCreateScriptUrlOptionFn = String Function(String input); + +/// An instance of a TrustedTypePolicy +@JS() +@staticInterop +@anonymous +abstract class DomTrustedTypePolicy {} + +/// (Some) methods of the [DomTrustedTypePolicy] +extension DomTrustedTypePolicyExtension on DomTrustedTypePolicy { + /// Create a `TrustedScriptURL` for the given [input]. + external DomTrustedScriptUrl createScriptURL(String input); +} + +/// An instance of a DomTrustedScriptUrl +@JS() +@staticInterop +@anonymous +abstract class DomTrustedScriptUrl {} + +// Getters + +/// window.document +@JS() +@staticInterop +@anonymous +external DomHtmlDocument get document; + +/// window.trustedTypes (may or may not be supported by the browser) +@JS() +@staticInterop +@anonymous +external DomTrustedTypePolicyFactory? get trustedTypes; + +/// window.console +@JS() +@staticInterop +@anonymous +external DomConsole get console; diff --git a/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart b/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart index a02197e0cf83..1c2670453135 100644 --- a/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart +++ b/packages/google_identity_services_web/lib/src/js_interop/google_accounts_id.dart @@ -7,9 +7,12 @@ // ignore_for_file: non_constant_identifier_names // * non_constant_identifier_names required to be able to use the same parameter -// names as the underlying JS library. +// names as the underlying library. -import 'dart:js_interop'; +@JS() +library google_accounts_id; + +import 'package:js/js.dart'; import 'shared.dart'; @@ -29,9 +32,7 @@ extension GoogleAccountsIdExtension on GoogleAccountsId { /// An undocumented method. /// /// Try it with 'debug'. - void setLogLevel(String level) => _setLogLevel(level.toJS); - @JS('setLogLevel') - external void _setLogLevel(JSString level); + external void setLogLevel(String level); /// Initializes the Sign In With Google client based on [IdConfiguration]. /// @@ -84,40 +85,16 @@ extension GoogleAccountsIdExtension on GoogleAccountsId { /// /// Method: google.accounts.id.prompt /// https://developers.google.com/identity/gsi/web/reference/js-reference#google.accounts.id.prompt - void prompt([PromptMomentListenerFn? momentListener]) { - if (momentListener == null) { - return _prompt(); - } - return _promptWithListener(momentListener.toJS); - } - - @JS('prompt') - external void _prompt(); - @JS('prompt') - external void _promptWithListener(JSFunction momentListener); + external void prompt([PromptMomentListenerFn momentListener]); /// Renders a Sign In With Google button in your web page. /// /// Method: google.accounts.id.renderButton /// https://developers.google.com/identity/gsi/web/reference/js-reference#google.accounts.id.renderButton - void renderButton( + external void renderButton( Object parent, [ - GsiButtonConfiguration? options, - ]) { - assert(parent is JSObject, - 'parent must be a JSObject. Use package:web to retrieve/create one.'); - parent as JSObject; - if (options == null) { - return _renderButton(parent); - } - return _renderButtonWithOptions(parent, options); - } - - @JS('renderButton') - external void _renderButton(JSObject parent); - @JS('renderButton') - external void _renderButtonWithOptions( - JSObject parent, GsiButtonConfiguration options); + GsiButtonConfiguration options, + ]); /// Record when the user signs out of your website in cookies. /// @@ -135,18 +112,7 @@ extension GoogleAccountsIdExtension on GoogleAccountsId { /// /// Method: google.accounts.id.storeCredential /// https://developers.google.com/identity/gsi/web/reference/js-reference#google.accounts.id.storeCredential - void storeCredential(Credential credential, [VoidFn? callback]) { - if (callback == null) { - return _jsStoreCredential(credential); - } - return _jsStoreCredentialWithCallback(credential, callback.toJS); - } - - @JS('storeCredential') - external void _jsStoreCredential(Credential credential); - @JS('storeCredential') - external void _jsStoreCredentialWithCallback( - Credential credential, JSFunction callback); + external void storeCredential(Credential credential, [VoidFn fallback]); /// Cancels the One Tap flow. /// @@ -166,19 +132,12 @@ extension GoogleAccountsIdExtension on GoogleAccountsId { /// The optional [callback] is a function that gets called to report on the /// success of the revocation call. /// + /// The [callback] parameter must be manually wrapped in [allowInterop] + /// before being passed to the [revoke] function. + /// /// Method: google.accounts.id.revoke /// https://developers.google.com/identity/gsi/web/reference/js-reference#google.accounts.id.revoke - void revoke(String hint, [RevocationResponseHandlerFn? callback]) { - if (callback == null) { - return _revoke(hint.toJS); - } - return _revokeWithCallback(hint.toJS, callback.toJS); - } - - @JS('revoke') - external void _revoke(JSString hint); - @JS('revoke') - external void _revokeWithCallback(JSString hint, JSFunction callback); + external void revoke(String hint, [RevocationResponseHandlerFn callback]); } /// The configuration object for the [initialize] method. @@ -190,7 +149,11 @@ extension GoogleAccountsIdExtension on GoogleAccountsId { @staticInterop abstract class IdConfiguration { /// Constructs a IdConfiguration object in JavaScript. - factory IdConfiguration({ + /// + /// The following properties need to be manually wrapped in [allowInterop] + /// before being passed to this constructor: [callback], [native_callback], + /// and [intermediate_iframe_close_callback]. + external factory IdConfiguration({ /// Your application's client ID, which is found and created in the Google /// Developers Console. required String client_id, @@ -265,7 +228,7 @@ abstract class IdConfiguration { /// intermediate iframe mode. And it has impact only to the intermediate /// iframe, instead of the One Tap iframe. The One Tap UI is removed before /// the callback is invoked. - VoidFn? intermediate_iframe_close_callback, + Function? intermediate_iframe_close_callback, /// Determines if the upgraded One Tap UX should be enabled on browsers /// that support Intelligent Tracking Prevention (ITP). The default value @@ -301,51 +264,6 @@ abstract class IdConfiguration { /// Allow the browser to control user sign-in prompts and mediate the /// sign-in flow between your website and Google. Defaults to false. bool? use_fedcm_for_prompt, - }) { - return IdConfiguration._toJS( - client_id: client_id.toJS, - auto_select: auto_select?.toJS, - callback: callback?.toJS, - login_uri: login_uri?.toString().toJS, - native_callback: native_callback?.toJS, - cancel_on_tap_outside: cancel_on_tap_outside?.toJS, - prompt_parent_id: prompt_parent_id?.toJS, - nonce: nonce?.toJS, - context: context?.toString().toJS, - state_cookie_domain: state_cookie_domain?.toJS, - ux_mode: ux_mode?.toString().toJS, - allowed_parent_origin: - allowed_parent_origin?.map((String s) => s.toJS).toList().toJS, - intermediate_iframe_close_callback: - intermediate_iframe_close_callback?.toJS, - itp_support: itp_support?.toJS, - login_hint: login_hint?.toJS, - hd: hd?.toJS, - use_fedcm_for_prompt: use_fedcm_for_prompt?.toJS, - ); - } - - // `IdConfiguration`'s external factory, defined as JSTypes. This is the actual JS-interop bit. - external factory IdConfiguration._toJS({ - JSString? client_id, - JSBoolean? auto_select, - JSFunction? callback, - JSString? login_uri, - JSFunction? native_callback, - JSBoolean? cancel_on_tap_outside, - JSString? prompt_parent_id, - JSString? nonce, - JSString? context, - JSString? state_cookie_domain, - JSString? ux_mode, - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray? allowed_parent_origin, - JSFunction? intermediate_iframe_close_callback, - JSBoolean? itp_support, - JSString? login_hint, - JSString? hd, - JSBoolean? use_fedcm_for_prompt, }); } @@ -363,53 +281,42 @@ abstract class PromptMomentNotification {} /// The methods of the [PromptMomentNotification] data type: extension PromptMomentNotificationExtension on PromptMomentNotification { /// Is this notification for a display moment? - bool isDisplayMoment() => _isDisplayMoment().toDart; - @JS('isDisplayMoment') - external JSBoolean _isDisplayMoment(); + external bool isDisplayMoment(); /// Is this notification for a display moment, and the UI is displayed? - bool isDisplayed() => _isDisplayed().toDart; - @JS('isDisplayed') - external JSBoolean _isDisplayed(); + external bool isDisplayed(); /// Is this notification for a display moment, and the UI isn't displayed? - bool isNotDisplayed() => _isNotDisplayed().toDart; - @JS('isNotDisplayed') - external JSBoolean _isNotDisplayed(); + external bool isNotDisplayed(); /// Is this notification for a skipped moment? - bool isSkippedMoment() => _isSkippedMoment().toDart; - @JS('isSkippedMoment') - external JSBoolean _isSkippedMoment(); + external bool isSkippedMoment(); /// Is this notification for a dismissed moment? - bool isDismissedMoment() => _isDismissedMoment().toDart; - @JS('isDismissedMoment') - external JSBoolean _isDismissedMoment(); + external bool isDismissedMoment(); + @JS('getMomentType') + external String _getMomentType(); + @JS('getNotDisplayedReason') + external String? _getNotDisplayedReason(); + @JS('getSkippedReason') + external String? _getSkippedReason(); + @JS('getDismissedReason') + external String? _getDismissedReason(); /// The moment type. - MomentType getMomentType() => - MomentType.values.byName(_getMomentType().toDart); - @JS('getMomentType') - external JSString _getMomentType(); + MomentType getMomentType() => MomentType.values.byName(_getMomentType()); /// The detailed reason why the UI isn't displayed. - MomentNotDisplayedReason? getNotDisplayedReason() => maybeEnum( - _getNotDisplayedReason()?.toDart, MomentNotDisplayedReason.values); - @JS('getNotDisplayedReason') - external JSString? _getNotDisplayedReason(); + MomentNotDisplayedReason? getNotDisplayedReason() => + maybeEnum(_getNotDisplayedReason(), MomentNotDisplayedReason.values); /// The detailed reason for the skipped moment. MomentSkippedReason? getSkippedReason() => - maybeEnum(_getSkippedReason()?.toDart, MomentSkippedReason.values); - @JS('getSkippedReason') - external JSString? _getSkippedReason(); + maybeEnum(_getSkippedReason(), MomentSkippedReason.values); /// The detailed reason for the dismissal. MomentDismissedReason? getDismissedReason() => - maybeEnum(_getDismissedReason()?.toDart, MomentDismissedReason.values); - @JS('getDismissedReason') - external JSString? _getDismissedReason(); + maybeEnum(_getDismissedReason(), MomentDismissedReason.values); } /// The object passed as the parameter of your [CallbackFn]. @@ -423,27 +330,21 @@ abstract class CredentialResponse {} /// The fields that are contained in the credential response object. extension CredentialResponseExtension on CredentialResponse { /// The ClientID for this Credential. - String? get client_id => _client_id?.toDart; - @JS('client_id') - external JSString? get _client_id; + external String? get client_id; /// Error while signing in. - String? get error => _error?.toDart; - @JS('error') - external JSString? get _error; + external String? get error; /// Details of the error while signing in. - String? get error_detail => _error_detail?.toDart; - @JS('error_detail') - external JSString? get _error_detail; + external String? get error_detail; /// This field is the ID token as a base64-encoded JSON Web Token (JWT) /// string. /// /// See more: https://developers.google.com/identity/gsi/web/reference/js-reference#credential - String? get credential => _credential?.toDart; - @JS('credential') - external JSString? get _credential; + external String? get credential; + @JS('select_by') + external String? get _select_by; /// This field sets how the credential was selected. /// @@ -452,9 +353,7 @@ extension CredentialResponseExtension on CredentialResponse { /// /// See more: https://developers.google.com/identity/gsi/web/reference/js-reference#select_by CredentialSelectBy? get select_by => - maybeEnum(_select_by?.toDart, CredentialSelectBy.values); - @JS('select_by') - external JSString? get _select_by; + maybeEnum(_select_by, CredentialSelectBy.values); } /// The type of the `callback` used to create an [IdConfiguration]. @@ -475,63 +374,41 @@ typedef CallbackFn = void Function(CredentialResponse credentialResponse); @staticInterop abstract class GsiButtonConfiguration { /// Constructs an options object for the [renderButton] method. - factory GsiButtonConfiguration({ + /// + /// The following properties need to be manually wrapped in [allowInterop] + /// before being passed to this constructor: + external factory GsiButtonConfiguration({ /// The button type. - ButtonType? type, + ButtonType type, /// The button theme. - ButtonTheme? theme, + ButtonTheme theme, /// The button size. - ButtonSize? size, + ButtonSize size, /// The button text. - ButtonText? text, + ButtonText text, /// The button shape. - ButtonShape? shape, + ButtonShape shape, /// The Google logo alignment in the button. - ButtonLogoAlignment? logo_alignment, + ButtonLogoAlignment logo_alignment, /// The minimum button width, in pixels. /// /// The maximum width is 400 pixels. - double? width, + double width, /// The pre-set locale of the button text. /// /// If not set, the browser's default locale or the Google session user's /// preference is used. - String? locale, + String locale, /// A function to be called when the button is clicked. - GsiButtonClickListenerFn? click_listener, - }) { - return GsiButtonConfiguration._toJS( - type: type.toString().toJS, - theme: theme.toString().toJS, - size: size.toString().toJS, - text: text?.toString().toJS, - shape: shape?.toString().toJS, - logo_alignment: logo_alignment?.toString().toJS, - width: width?.toJS, - locale: locale?.toJS, - click_listener: click_listener?.toJS, - ); - } - - // `GsiButtonConfiguration`'s external factory, defined as JSTypes. - external factory GsiButtonConfiguration._toJS({ - JSString? type, - JSString? theme, - JSString? size, - JSString? text, - JSString? shape, - JSString? logo_alignment, - JSNumber? width, - JSString? locale, - JSFunction? click_listener, + GsiButtonClickListenerFn click_listener, }); } @@ -543,14 +420,10 @@ abstract class GsiButtonData {} /// The fields that are contained in the button data. extension GsiButtonDataExtension on GsiButtonData { /// Nonce - String? get nonce => _nonce?.toDart; - @JS('nonce') - external JSString? get _nonce; + external String? get nonce; /// State - String? get state => _state?.toDart; - @JS('state') - external JSString? get _state; + external String? get state; } /// The type of the [GsiButtonConfiguration] `click_listener` function. @@ -571,32 +444,19 @@ typedef GsiButtonClickListenerFn = void Function(GsiButtonData? gsiButtonData); @staticInterop abstract class Credential { /// - factory Credential({ + external factory Credential({ required String id, required String password, - }) => - Credential._toJS( - id: id.toJS, - password: password.toJS, - ); - - external factory Credential._toJS({ - JSString id, - JSString password, }); } /// The fields that are contained in the [Credential] object. extension CredentialExtension on Credential { /// Identifies the user. - String? get id => _id.toDart; - @JS('id') - external JSString get _id; + external String get id; /// The password. - String? get password => _password.toDart; - @JS('password') - external JSString get _password; + external String get password; } /// The type of the `native_callback` used to create an [IdConfiguration]. @@ -629,13 +489,9 @@ abstract class RevocationResponse {} extension RevocationResponseExtension on RevocationResponse { /// This field is a boolean value set to true if the revoke method call /// succeeded or false on failure. - bool get successful => _successful.toDart; - @JS('successful') - external JSBoolean get _successful; + external bool get successful; /// This field is a string value and contains a detailed error message if the /// revoke method call failed, it is undefined on success. - String? get error => _error?.toDart; - @JS('error') - external JSString? get _error; + external String? get error; } diff --git a/packages/google_identity_services_web/lib/src/js_interop/google_accounts_oauth2.dart b/packages/google_identity_services_web/lib/src/js_interop/google_accounts_oauth2.dart index 9c97ba43b6aa..83061d0b9ded 100644 --- a/packages/google_identity_services_web/lib/src/js_interop/google_accounts_oauth2.dart +++ b/packages/google_identity_services_web/lib/src/js_interop/google_accounts_oauth2.dart @@ -12,8 +12,9 @@ @JS() library google_accounts_oauth2; -import 'dart:js_interop'; +import 'package:js/js.dart'; +import 'dom.dart'; import 'shared.dart'; /// Binding to the `google.accounts.oauth2` JS global. @@ -44,7 +45,7 @@ extension GoogleAccountsOauth2Extension on GoogleAccountsOauth2 { // Method: google.accounts.oauth2.hasGrantedAllScopes // https://developers.google.com/identity/oauth2/web/reference/js-reference#google.accounts.oauth2.hasGrantedAllScopes @JS('hasGrantedAllScopes') - external bool _hasGrantedScope(TokenResponse token, JSString scope); + external bool _hasGrantedScope(TokenResponse token, String scope); /// Checks if hte user has granted **all** the specified [scopes]. /// @@ -54,7 +55,7 @@ extension GoogleAccountsOauth2Extension on GoogleAccountsOauth2 { /// https://developers.google.com/identity/oauth2/web/reference/js-reference#google.accounts.oauth2.hasGrantedAllScopes bool hasGrantedAllScopes(TokenResponse tokenResponse, List scopes) { return scopes - .every((String scope) => _hasGrantedScope(tokenResponse, scope.toJS)); + .every((String scope) => _hasGrantedScope(tokenResponse, scope)); } /// Checks if hte user has granted **all** the specified [scopes]. @@ -64,8 +65,7 @@ extension GoogleAccountsOauth2Extension on GoogleAccountsOauth2 { /// Method: google.accounts.oauth2.hasGrantedAllScopes /// https://developers.google.com/identity/oauth2/web/reference/js-reference#google.accounts.oauth2.hasGrantedAllScopes bool hasGrantedAnyScopes(TokenResponse tokenResponse, List scopes) { - return scopes - .any((String scope) => _hasGrantedScope(tokenResponse, scope.toJS)); + return scopes.any((String scope) => _hasGrantedScope(tokenResponse, scope)); } /// Revokes all of the scopes that the user granted to the app. @@ -77,20 +77,10 @@ extension GoogleAccountsOauth2Extension on GoogleAccountsOauth2 { /// /// Method: google.accounts.oauth2.revoke /// https://developers.google.com/identity/oauth2/web/reference/js-reference#google.accounts.oauth2.revoke - void revoke( + external void revoke( String accessToken, [ - RevokeTokenDoneFn? done, - ]) { - if (done == null) { - return _revoke(accessToken.toJS); - } - return _revokeWithDone(accessToken.toJS, done.toJS); - } - - @JS('revoke') - external void _revoke(JSString accessToken); - @JS('revoke') - external void _revokeWithDone(JSString accessToken, JSFunction done); + RevokeTokenDoneFn done, + ]); } /// The configuration object for the [initCodeClient] method. @@ -105,54 +95,19 @@ abstract class CodeClientConfig { /// /// The [callback] property must be wrapped in [allowInterop] before it's /// passed to this constructor. - factory CodeClientConfig({ + external factory CodeClientConfig({ required String client_id, - required List scope, - bool? include_granted_scopes, - Uri? redirect_uri, + required String scope, + String? redirect_uri, + bool? auto_select, CodeClientCallbackFn? callback, + ErrorCallbackFn? error_callback, String? state, - bool? enable_granular_consent, - @Deprecated('Use `enable_granular_consent` instead.') bool? enable_serial_consent, - String? login_hint, - String? hd, + String? hint, + String? hosted_domain, UxMode? ux_mode, bool? select_account, - ErrorCallbackFn? error_callback, - }) { - assert(scope.isNotEmpty); - return CodeClientConfig._toJS( - client_id: client_id.toJS, - scope: scope.join(' ').toJS, - include_granted_scopes: include_granted_scopes?.toJS, - redirect_uri: redirect_uri?.toString().toJS, - callback: callback?.toJS, - state: state?.toJS, - enable_granular_consent: enable_granular_consent?.toJS, - enable_serial_consent: enable_serial_consent?.toJS, - login_hint: login_hint?.toJS, - hd: hd?.toJS, - ux_mode: ux_mode.toString().toJS, - select_account: select_account?.toJS, - error_callback: error_callback?.toJS, - ); - } - - external factory CodeClientConfig._toJS({ - JSString? client_id, - JSString? scope, - JSBoolean? include_granted_scopes, - JSString? redirect_uri, - JSFunction? callback, - JSString? state, - JSBoolean? enable_granular_consent, - JSBoolean? enable_serial_consent, - JSString? login_hint, - JSString? hd, - JSString? ux_mode, - JSBoolean? select_account, - JSFunction? error_callback, }); } @@ -183,38 +138,26 @@ abstract class CodeResponse {} /// The fields that are contained in the code response object. extension CodeResponseExtension on CodeResponse { /// The authorization code of a successful token response. - String? get code => _code?.toDart; - @JS('code') - external JSString? get _code; + external String get code; - /// A list of scopes that are approved by the user. - List get scope => _scope?.toDart.split(' ') ?? List.empty(); - @JS('scope') - external JSString? get _scope; + /// A space-delimited list of scopes that are approved by the user. + external String get scope; /// The string value that your application uses to maintain state between your /// authorization request and the response. - String? get state => _state?.toDart; - @JS('state') - external JSString? get _state; + external String get state; /// A single ASCII error code. - String? get error => _error?.toDart; - @JS('error') - external JSString? get _error; + external String? get error; /// Human-readable ASCII text providing additional information, used to assist /// the client developer in understanding the error that occurred. - String? get error_description => _error_description?.toDart; - @JS('error_description') - external JSString? get _error_description; + external String? get error_description; /// A URI identifying a human-readable web page with information about the /// error, used to provide the client developer with additional information /// about the error. - String? get error_uri => _error_uri?.toDart; - @JS('error_uri') - external JSString? get _error_uri; + external String? get error_uri; } /// The type of the `callback` function passed to [CodeClientConfig]. @@ -232,48 +175,16 @@ abstract class TokenClientConfig { /// /// The [callback] property must be wrapped in [allowInterop] before it's /// passed to this constructor. - factory TokenClientConfig({ + external factory TokenClientConfig({ required String client_id, - required TokenClientCallbackFn callback, - required List scope, - bool? include_granted_scopes, + required TokenClientCallbackFn? callback, + required String scope, + ErrorCallbackFn? error_callback, String? prompt, - bool? enable_granular_consent, - @Deprecated('Use `enable_granular_consent` instead.') bool? enable_serial_consent, - String? login_hint, - String? hd, + String? hint, + String? hosted_domain, String? state, - ErrorCallbackFn? error_callback, - }) { - assert(scope.isNotEmpty); - return TokenClientConfig._toJS( - client_id: client_id.toJS, - callback: callback.toJS, - scope: scope.join(' ').toJS, - include_granted_scopes: include_granted_scopes?.toJS, - prompt: prompt?.toJS, - enable_granular_consent: enable_granular_consent?.toJS, - enable_serial_consent: enable_serial_consent?.toJS, - login_hint: login_hint?.toJS, - hd: hd?.toJS, - state: state?.toJS, - error_callback: error_callback?.toJS, - ); - } - - external factory TokenClientConfig._toJS({ - JSString? client_id, - JSFunction? callback, - JSString? scope, - JSBoolean? include_granted_scopes, - JSString? prompt, - JSBoolean? enable_granular_consent, - JSBoolean? enable_serial_consent, - JSString? login_hint, - JSString? hd, - JSString? state, - JSFunction? error_callback, }); } @@ -290,20 +201,9 @@ abstract class TokenClient {} /// The methods available on the [TokenClient]. extension TokenClientExtension on TokenClient { /// Starts the OAuth 2.0 Code UX flow. - void requestAccessToken([ - OverridableTokenClientConfig? overrideConfig, - ]) { - if (overrideConfig == null) { - return _requestAccessToken(); - } - return _requestAccessTokenWithConfig(overrideConfig); - } - - @JS('requestAccessToken') - external void _requestAccessToken(); - @JS('requestAccessToken') - external void _requestAccessTokenWithConfig( - OverridableTokenClientConfig config); + external void requestAccessToken([ + OverridableTokenClientConfig overrideConfig, + ]); } /// The overridable configuration object for the [TokenClientExtension.requestAccessToken] method. @@ -318,42 +218,18 @@ abstract class OverridableTokenClientConfig { /// /// The [callback] property must be wrapped in [allowInterop] before it's /// passed to this constructor. - factory OverridableTokenClientConfig({ - /// A list of scopes that identify the resources that your application could - /// access on the user's behalf. These values inform the consent screen that - /// Google displays to the user. - // b/251971390 - List? scope, - - /// Enables applications to use incremental authorization to request access - /// to additional scopes in context. If you set this parameter's value to - /// `false` and the authorization request is granted, then the new access - /// token will only cover any scopes to which the `scope` requested in this - /// [OverridableTokenClientConfig]. - bool? include_granted_scopes, - + external factory OverridableTokenClientConfig({ /// A space-delimited, case-sensitive list of prompts to present the user. /// /// See `prompt` in [TokenClientConfig]. String? prompt, - /// If set to false, "more granular Google Account permissions" would be - /// disabled for OAuth client IDs created before 2019. If both - /// `enable_granular_consent` and `enable_serial_consent` are set, only - /// `enable_granular_consent` value would take effect and - /// `enable_serial_consent` value would be ignored. + /// For clients created before 2019, when set to `false`, disables "more + /// granular Google Account permissions". /// - /// No effect for newer OAuth client IDs, since more granular permissions is - /// always enabled for them. - bool? enable_granular_consent, - - /// This has the same effect as `enable_granular_consent`. Existing - /// applications that use `enable_serial_consent` can continue to do so, but - /// you are encouraged to update your code to use `enable_granular_consent` - /// in your next application update. + /// This setting has no effect in newer clients. /// /// See: https://developers.googleblog.com/2018/10/more-granular-google-account.html - @Deprecated('Use `enable_granular_consent` instead.') bool? enable_serial_consent, /// When your app knows which user it is trying to authenticate, it can @@ -367,33 +243,23 @@ abstract class OverridableTokenClientConfig { /// equivalent to the user's Google ID. /// /// About Multiple Sign-in: https://support.google.com/accounts/answer/1721977 - String? login_hint, + String? hint, + + /// A space-delimited list of scopes that identify the resources that your + /// application could access on the user's behalf. These values inform the + /// consent screen that Google displays to the user. + // b/251971390 + String? scope, /// **Not recommended.** Specifies any string value that your application /// uses to maintain state between your authorization request and the /// authorization server's response. String? state, - }) { - assert(scope == null || scope.isNotEmpty); - return OverridableTokenClientConfig._toJS( - scope: scope?.join(' ').toJS, - include_granted_scopes: include_granted_scopes?.toJS, - prompt: prompt?.toJS, - enable_granular_consent: enable_granular_consent?.toJS, - enable_serial_consent: enable_serial_consent?.toJS, - login_hint: login_hint?.toJS, - state: state?.toJS, - ); - } - external factory OverridableTokenClientConfig._toJS({ - JSString? scope, - JSBoolean? include_granted_scopes, - JSString? prompt, - JSBoolean? enable_granular_consent, - JSBoolean? enable_serial_consent, - JSString? login_hint, - JSString? state, + /// Preserves previously requested scopes in this new request. + /// + /// (Undocumented) + bool? include_granted_scopes, }); } @@ -408,86 +274,70 @@ abstract class TokenResponse {} /// The fields that are contained in the code response object. extension TokenResponseExtension on TokenResponse { /// The access token of a successful token response. - String? get access_token => _access_token?.toDart; - @JS('access_token') - external JSString? get _access_token; + external String get access_token; /// The lifetime in seconds of the access token. - int? get expires_in => _expires_in?.toDartInt; - @JS('expires_in') - external JSNumber? get _expires_in; + external int get expires_in; /// The hosted domain the signed-in user belongs to. - String? get hd => _hd?.toDart; - @JS('hd') - external JSString? get _hd; + external String get hd; /// The prompt value that was used from the possible list of values specified /// by [TokenClientConfig] or [OverridableTokenClientConfig]. - String? get prompt => _prompt?.toDart; - @JS('prompt') - external JSString? get _prompt; + external String get prompt; /// The type of the token issued. - String? get token_type => _token_type?.toDart; - @JS('token_type') - external JSString? get _token_type; + external String get token_type; - /// A list of scopes that are approved by the user. - List get scope => _scope?.toDart.split(' ') ?? List.empty(); - @JS('scope') - external JSString? get _scope; + /// A space-delimited list of scopes that are approved by the user. + external String get scope; /// The string value that your application uses to maintain state between your /// authorization request and the response. - String? get state => _state?.toDart; - @JS('state') - external JSString? get _state; + external String get state; /// A single ASCII error code. - String? get error => _error?.toDart; - @JS('error') - external JSString? get _error; + external String? get error; /// Human-readable ASCII text providing additional information, used to assist /// the client developer in understanding the error that occurred. - String? get error_description => _error_description?.toDart; - @JS('error_description') - external JSString? get _error_description; + external String? get error_description; /// A URI identifying a human-readable web page with information about the /// error, used to provide the client developer with additional information /// about the error. - String? get error_uri => _error_uri?.toDart; - @JS('error_uri') - external JSString? get _error_uri; + external String? get error_uri; } /// The type of the `callback` function passed to [TokenClientConfig]. typedef TokenClientCallbackFn = void Function(TokenResponse response); /// The type of the `error_callback` in both oauth2 initXClient calls. -typedef ErrorCallbackFn = void Function(GoogleIdentityServicesError? error); +/// +/// (Currently undocumented) +/// +/// `error` should be of type [GoogleIdentityServicesError]?, but it cannot be +/// because of this DDC bug: https://github.com/dart-lang/sdk/issues/50899 +typedef ErrorCallbackFn = void Function(Object? error); /// An error returned by `initTokenClient` or `initDataClient`. +/// +/// Cannot be used: https://github.com/dart-lang/sdk/issues/50899 @JS() @staticInterop -abstract class GoogleIdentityServicesError {} +abstract class GoogleIdentityServicesError extends DomError {} /// Methods of the GoogleIdentityServicesError object. +/// +/// Cannot be used: https://github.com/dart-lang/sdk/issues/50899 extension GoogleIdentityServicesErrorExtension on GoogleIdentityServicesError { - /// The type of error - GoogleIdentityServicesErrorType get type => - GoogleIdentityServicesErrorType.values.byName(_type.toDart); @JS('type') - external JSString get _type; + external String get _type; + // String get _type => js_util.getProperty(this, 'type'); - /// A human-readable description of the error `type`. - /// - /// (Undocumented) - String? get message => _message?.toDart; - @JS('message') - external JSString? get _message; + /// The type of error + GoogleIdentityServicesErrorType get type => + GoogleIdentityServicesErrorType.values.byName(_type); } /// The signature of the `done` function for [revoke]. @@ -505,18 +355,12 @@ abstract class TokenRevocationResponse {} extension TokenRevocationResponseExtension on TokenRevocationResponse { /// This field is a boolean value set to true if the revoke method call /// succeeded or false on failure. - bool get successful => _successful.toDart; - @JS('successful') - external JSBoolean get _successful; + external bool get successful; /// This field is a string value and contains a detailed error message if the /// revoke method call failed, it is undefined on success. - String? get error => _error?.toDart; - @JS('error') - external JSString? get _error; + external String? get error; /// The description of the error. - String? get error_description => _error_description?.toDart; - @JS('error_description') - external JSString? get _error_description; + external String? get error_description; } diff --git a/packages/google_identity_services_web/lib/src/js_interop/load_callback.dart b/packages/google_identity_services_web/lib/src/js_interop/load_callback.dart index 7df615017f7f..fa7c4ca96c09 100644 --- a/packages/google_identity_services_web/lib/src/js_interop/load_callback.dart +++ b/packages/google_identity_services_web/lib/src/js_interop/load_callback.dart @@ -8,7 +8,7 @@ @JS() library id_load_callback; -import 'dart:js_interop'; +import 'package:js/js.dart'; import 'shared.dart'; @@ -17,14 +17,10 @@ import 'shared.dart'; // https://developers.google.com/identity/gsi/web/reference/js-reference#onGoogleLibraryLoad */ -@JS('onGoogleLibraryLoad') -@staticInterop -external set _onGoogleLibraryLoad(JSFunction callback); - /// Method called after the Sign In With Google JavaScript library is loaded. /// /// The [callback] parameter must be manually wrapped in [allowInterop] /// before being set to the [onGoogleLibraryLoad] property. -set onGoogleLibraryLoad(VoidFn function) { - _onGoogleLibraryLoad = function.toJS; -} +@JS() +@staticInterop +external set onGoogleLibraryLoad(VoidFn callback); diff --git a/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart b/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart deleted file mode 100644 index 76dc411c103e..000000000000 --- a/packages/google_identity_services_web/lib/src/js_interop/package_web_tweaks.dart +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/// Provides some useful tweaks to `package:web`. -library package_web_tweaks; - -import 'dart:js_interop'; -import 'package:web/web.dart' as web; - -/// This extension gives web.window a nullable getter to the `trustedTypes` -/// property, which needs to be used to check for feature support. -extension NullableTrustedTypesGetter on web.Window { - /// - @JS('trustedTypes') - external web.TrustedTypePolicyFactory? get nullableTrustedTypes; -} - -/// This extension allows a trusted type policy to create a script URL without -/// the `args` parameter (which in Chrome currently fails). -extension CreateScriptUrlWithoutArgs on web.TrustedTypePolicy { - /// - @JS('createScriptURL') - external web.TrustedScriptURL createScriptURLNoArgs( - String input, - ); -} - -/// This extension allows setting a TrustedScriptURL as the src of a script element, -/// which currently only accepts a string. -extension TrustedTypeSrcAttribute on web.HTMLScriptElement { - /// - @JS('src') - external set srcTT(web.TrustedScriptURL value); -} diff --git a/packages/google_identity_services_web/lib/src/js_interop/shared.dart b/packages/google_identity_services_web/lib/src/js_interop/shared.dart index a56450383261..0bd842b3e06b 100644 --- a/packages/google_identity_services_web/lib/src/js_interop/shared.dart +++ b/packages/google_identity_services_web/lib/src/js_interop/shared.dart @@ -118,10 +118,7 @@ enum MomentSkippedReason { tap_outside('tap_outside'), /// issuing_failed - issuing_failed('issuing_failed'), - - /// Unknown reason - unknown_reason('unknown_reason'); + issuing_failed('issuing_failed'); /// const MomentSkippedReason(String reason) : _reason = reason; @@ -140,10 +137,7 @@ enum MomentDismissedReason { cancel_called('cancel_called'), /// flow_restarted - flow_restarted('flow_restarted'), - - /// Unknown reason - unknown_reason('unknown_reason'); + flow_restarted('flow_restarted'); /// const MomentDismissedReason(String reason) : _reason = reason; @@ -210,13 +204,7 @@ enum CredentialSelectBy { /// A user without an existing session first pressed the Sign In With Google /// button to select a Google Account and then pressed the Confirm button to /// consent and share credentials. - btn_confirm_add_session('btn_confirm_add_session'), - - /// A user with an existing session used the browser's "FedCM" flow. - fedcm('fedcm'), - - /// A fedcm authentication without user intervention. - fedcm_auto('fedcm_auto'); + btn_confirm_add_session('btn_confirm_add_session'); /// const CredentialSelectBy(String selectBy) : _selectBy = selectBy; diff --git a/packages/google_identity_services_web/lib/src/js_loader.dart b/packages/google_identity_services_web/lib/src/js_loader.dart index bd876f98c5ce..0f2dc7b409c0 100644 --- a/packages/google_identity_services_web/lib/src/js_loader.dart +++ b/packages/google_identity_services_web/lib/src/js_loader.dart @@ -3,12 +3,11 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:js_interop'; -import 'package:web/web.dart' as web; +import 'package:js/js.dart' show allowInterop; +import 'js_interop/dom.dart'; import 'js_interop/load_callback.dart'; -import 'js_interop/package_web_tweaks.dart'; // The URL from which the script should be downloaded. const String _url = 'https://accounts.google.com/gsi/client'; @@ -18,41 +17,39 @@ const String _defaultTrustedPolicyName = 'gis-dart'; /// Loads the GIS SDK for web, using Trusted Types API when available. Future loadWebSdk({ - web.HTMLElement? target, + DomHtmlElement? target, String trustedTypePolicyName = _defaultTrustedPolicyName, }) { final Completer completer = Completer(); - onGoogleLibraryLoad = () => completer.complete(); + onGoogleLibraryLoad = allowInterop(() => completer.complete()); // If TrustedTypes are available, prepare a trusted URL. - web.TrustedScriptURL? trustedUrl; - if (web.window.nullableTrustedTypes != null) { - web.console.debug( - 'TrustedTypes available. Creating policy: $trustedTypePolicyName'.toJS, + DomTrustedScriptUrl? trustedUrl; + if (trustedTypes != null) { + console.debug( + 'TrustedTypes available. Creating policy:', + trustedTypePolicyName, ); + final DomTrustedTypePolicyFactory factory = trustedTypes!; try { - final web.TrustedTypePolicy policy = web.window.trustedTypes.createPolicy( + final DomTrustedTypePolicy policy = factory.createPolicy( trustedTypePolicyName, - web.TrustedTypePolicyOptions( - createScriptURL: ((JSString url) => _url).toJS, + DomTrustedTypePolicyOptions( + createScriptURL: allowInterop((String url) => _url), )); - trustedUrl = policy.createScriptURLNoArgs(_url); + trustedUrl = policy.createScriptURL(_url); } catch (e) { throw TrustedTypesException(e.toString()); } } - final web.HTMLScriptElement script = - web.document.createElement('script') as web.HTMLScriptElement + final DomHtmlScriptElement script = + document.createElement('script') as DomHtmlScriptElement + ..src = trustedUrl ?? _url ..async = true ..defer = true; - if (trustedUrl != null) { - script.srcTT = trustedUrl; - } else { - script.src = _url; - } - (target ?? web.document.head!).appendChild(script); + (target ?? document.head).appendChild(script); return completer.future; } diff --git a/packages/google_identity_services_web/pubspec.yaml b/packages/google_identity_services_web/pubspec.yaml index 2f1e5b913901..25e99cd199a5 100644 --- a/packages/google_identity_services_web/pubspec.yaml +++ b/packages/google_identity_services_web/pubspec.yaml @@ -2,14 +2,14 @@ name: google_identity_services_web description: A Dart JS-interop layer for Google Identity Services. Google's new sign-in SDK for Web that supports multiple types of credentials. repository: https://github.com/flutter/packages/tree/main/packages/google_identity_services_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_identiy_services_web%22 -version: 0.3.0+2 +version: 0.2.2 environment: - sdk: ">=3.2.0 <4.0.0" + sdk: ">=3.0.0 <4.0.0" dependencies: + js: ^0.6.4 meta: ^1.3.0 - web: ">=0.3.0 <0.5.0" dev_dependencies: path: ^1.8.1 diff --git a/packages/google_identity_services_web/test/js_loader_test.dart b/packages/google_identity_services_web/test/js_loader_test.dart index ec2c07428a55..028f5fd602a5 100644 --- a/packages/google_identity_services_web/test/js_loader_test.dart +++ b/packages/google_identity_services_web/test/js_loader_test.dart @@ -2,15 +2,17 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@TestOn('browser') // Uses package:web +@TestOn('browser') // Uses package:js import 'dart:async'; -import 'dart:js_interop'; import 'package:google_identity_services_web/loader.dart'; +import 'package:google_identity_services_web/src/js_interop/dom.dart' as dom; import 'package:google_identity_services_web/src/js_loader.dart'; + +import 'package:js/js_util.dart' as js_util; + import 'package:test/test.dart'; -import 'package:web/web.dart' as web; // NOTE: This file needs to be separated from the others because Content // Security Policies can never be *relaxed* once set. @@ -24,8 +26,7 @@ import 'package:web/web.dart' as web; void main() { group('loadWebSdk (no TrustedTypes)', () { - final web.HTMLDivElement target = - web.document.createElement('div') as web.HTMLDivElement; + final dom.DomHtmlElement target = dom.document.createElement('div'); test('Injects script into desired target', () async { // This test doesn't simulate the callback that completes the future, and @@ -33,14 +34,22 @@ void main() { unawaited(loadWebSdk(target: target)); // Target now should have a child that is a script element - final web.Node? injected = target.firstChild; - expect(injected, isNotNull); - expect(injected, isA()); - - final web.HTMLScriptElement script = injected! as web.HTMLScriptElement; - expect(script.defer, isTrue); - expect(script.async, isTrue); - expect(script.src, 'https://accounts.google.com/gsi/client'); + final Object children = js_util.getProperty(target, 'children'); + final Object injected = js_util.callMethod( + children, + 'item', + [0], + ); + expect(injected, isA()); + + final dom.DomHtmlScriptElement script = + injected as dom.DomHtmlScriptElement; + expect(js_util.getProperty(script, 'defer'), isTrue); + expect(js_util.getProperty(script, 'async'), isTrue); + expect( + js_util.getProperty(script, 'src'), + 'https://accounts.google.com/gsi/client', + ); }); test('Completes when the script loads', () async { @@ -48,16 +57,14 @@ void main() { Future.delayed(const Duration(milliseconds: 100), () { // Simulate the library calling `window.onGoogleLibraryLoad`. - web.window.onGoogleLibraryLoad(); + js_util.callMethod( + js_util.globalThis, + 'onGoogleLibraryLoad', + [], + ); }); await expectLater(loadFuture, completes); }); }); } - -extension on web.Window { - void onGoogleLibraryLoad() => _onGoogleLibraryLoad(); - @JS('onGoogleLibraryLoad') - external JSFunction? _onGoogleLibraryLoad(); -} diff --git a/packages/google_identity_services_web/test/js_loader_tt_custom_test.dart b/packages/google_identity_services_web/test/js_loader_tt_custom_test.dart index 0ee856f68f06..6668be09d02c 100644 --- a/packages/google_identity_services_web/test/js_loader_tt_custom_test.dart +++ b/packages/google_identity_services_web/test/js_loader_tt_custom_test.dart @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@TestOn('browser') // Uses package:web +@TestOn('browser') // Uses package:js import 'package:google_identity_services_web/loader.dart'; +import 'package:google_identity_services_web/src/js_interop/dom.dart' as dom; + import 'package:test/test.dart'; -import 'package:web/web.dart' as web; import 'tools.dart'; @@ -22,8 +23,7 @@ import 'tools.dart'; void main() { group('loadWebSdk (TrustedTypes configured)', () { - final web.HTMLDivElement target = - web.document.createElement('div') as web.HTMLDivElement; + final dom.DomHtmlElement target = dom.document.createElement('div'); injectMetaTag({ 'http-equiv': 'Content-Security-Policy', 'content': "trusted-types my-custom-policy-name 'allow-duplicates';", diff --git a/packages/google_identity_services_web/test/js_loader_tt_forbidden_test.dart b/packages/google_identity_services_web/test/js_loader_tt_forbidden_test.dart index 3806e9087dad..e95b5f9e298f 100644 --- a/packages/google_identity_services_web/test/js_loader_tt_forbidden_test.dart +++ b/packages/google_identity_services_web/test/js_loader_tt_forbidden_test.dart @@ -2,11 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -@TestOn('browser') // Uses package:web +@TestOn('browser') // Uses package:js import 'package:google_identity_services_web/loader.dart'; +import 'package:google_identity_services_web/src/js_interop/dom.dart' as dom; + import 'package:test/test.dart'; -import 'package:web/web.dart' as web; import 'tools.dart'; @@ -22,8 +23,7 @@ import 'tools.dart'; void main() { group('loadWebSdk (TrustedTypes forbidden)', () { - final web.HTMLDivElement target = - web.document.createElement('div') as web.HTMLDivElement; + final dom.DomHtmlElement target = dom.document.createElement('div'); injectMetaTag({ 'http-equiv': 'Content-Security-Policy', 'content': "trusted-types 'none';", diff --git a/packages/google_identity_services_web/test/tools.dart b/packages/google_identity_services_web/test/tools.dart index 3ae00be0fdb1..dd3d68e34ef2 100644 --- a/packages/google_identity_services_web/test/tools.dart +++ b/packages/google_identity_services_web/test/tools.dart @@ -2,14 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'package:web/web.dart' as web; +import 'package:google_identity_services_web/src/js_interop/dom.dart' as dom; +import 'package:js/js_util.dart' as js_util; -/// Injects a `` tag with the provided [attributes] into the [web.document]. +/// Injects a `` tag with the provided [attributes] into the [dom.document]. void injectMetaTag(Map attributes) { - final web.HTMLMetaElement meta = - web.document.createElement('meta') as web.HTMLMetaElement; + final dom.DomHtmlElement meta = dom.document.createElement('meta'); for (final MapEntry attribute in attributes.entries) { - meta.setAttribute(attribute.key, attribute.value); + js_util.callMethod( + meta, + 'setAttribute', + [attribute.key, attribute.value], + ); } - web.document.head!.appendChild(meta); + dom.document.head.appendChild(meta); } diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/google_maps_flutter/google_maps_flutter/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/google_maps_flutter/google_maps_flutter/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/google_maps_flutter/google_maps_flutter/example/android/gradle/wrapper/gradle-wrapper.properties index 068cdb2dc260..774fae87671b 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/google_maps_flutter/google_maps_flutter/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_controller.dart b/packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_controller.dart index 01716232814e..63351a474950 100644 --- a/packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_controller.dart +++ b/packages/google_maps_flutter/google_maps_flutter/example/integration_test/src/maps_controller.dart @@ -70,9 +70,7 @@ void runTests() { // Android doesn't like the layout required for the web, so we skip web in this test. // The equivalent web test already exists here: // https://github.com/flutter/packages/blob/c43cc13498a1a1c4f3d1b8af2add9ce7c15bd6d0/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/projection_test.dart#L78 - skip: isWeb || - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - isIOS); + skip: isWeb); testWidgets('testGetVisibleRegion', (WidgetTester tester) async { final Key key = GlobalKey(); @@ -137,9 +135,7 @@ void runTests() { expect(firstVisibleRegion, isNot(secondVisibleRegion)); expect(secondVisibleRegion.contains(newCenter), isTrue); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: isIOS); + }); testWidgets('testSetMapStyle valid Json String', (WidgetTester tester) async { final Key key = GlobalKey(); @@ -273,9 +269,7 @@ void runTests() { await tester.pumpAndSettle(); zoom = await controller.getZoomLevel(); expect(zoom, equals(7)); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: isIOS); + }); testWidgets('testScreenCoordinate', (WidgetTester tester) async { final Key key = GlobalKey(); @@ -308,9 +302,7 @@ void runTests() { final ScreenCoordinate topLeft = await controller.getScreenCoordinate(northWest); expect(topLeft, const ScreenCoordinate(x: 0, y: 0)); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: isIOS); + }); testWidgets('testResizeWidget', (WidgetTester tester) async { final Completer controllerCompleter = @@ -422,8 +414,7 @@ void runTests() { }, // TODO(cyanglaz): un-skip the test when we can test this on CI with API key enabled. // https://github.com/flutter/flutter/issues/57057 - // https://github.com/flutter/flutter/issues/139825 - skip: isAndroid || isWeb || isIOS); + skip: isAndroid || isWeb); testWidgets( 'testCloudMapId', diff --git a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md index 3b4a2f4c4381..2fe148c5090d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/CHANGELOG.md @@ -1,7 +1,5 @@ -## 2.6.0 +## NEXT -* Fixes missing updates in TLHC mode. -* Switched default display mode to TLHC mode. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 2.5.3 diff --git a/packages/google_maps_flutter/google_maps_flutter_android/README.md b/packages/google_maps_flutter/google_maps_flutter_android/README.md index 8c482864dfdf..836ab2c9835a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/README.md +++ b/packages/google_maps_flutter/google_maps_flutter_android/README.md @@ -30,26 +30,26 @@ void main() { final GoogleMapsFlutterPlatform mapsImplementation = GoogleMapsFlutterPlatform.instance; if (mapsImplementation is GoogleMapsFlutterAndroid) { - // Force Hybrid Composition mode. mapsImplementation.useAndroidViewSurface = true; } // ··· } ``` -### Texture Layer Hybrid Composition +### Hybrid Composition -This is the the current default mode and corresponds to `useAndroidViewSurface = false`. -This mode is more performant than Hybrid Composition and we recommend that you use this mode. +This is the current default mode, and corresponds to +`useAndroidViewSurface = true`. It ensures that the map display will work as +expected, at the cost of some performance. -### Hybrid Composition +### Texture Layer Hybrid Composition -This mode is available for backwards compatability and corresponds to `useAndroidViewSurface = true`. -We do not recommend its use as it is less performant than Texture Layer Hybrid Composition and -certain flutter rendering effects are not supported. +This is a new display mode used by most plugins starting with Flutter 3.0, and +corresponds to `useAndroidViewSurface = false`. This is more performant than +Hybrid Composition, but currently [misses certain map updates][4]. -If you require this mode for correctness, please file a bug so we can investigate and fix -the issue in the TLHC mode. +This mode will likely become the default in future versions if/when the +missed updates issue can be resolved. ## Map renderer @@ -70,13 +70,8 @@ AndroidMapRenderer mapRenderer = AndroidMapRenderer.platformDefault; } ``` -`AndroidMapRenderer.platformDefault` corresponds to `AndroidMapRenderer.latest`. - -You are not guaranteed to get the requested renderer. For example, on emulators without -Google Play the latest renderer will not be available and the legacy renderer will always be used. - -WARNING: `AndroidMapRenderer.legacy` is known to crash apps and is no longer supported by the Google Maps team -and therefore cannot be supported by the Flutter team. +Available values are `AndroidMapRenderer.latest`, `AndroidMapRenderer.legacy`, `AndroidMapRenderer.platformDefault`. +Note that getting the requested renderer as a response is not guaranteed. [1]: https://pub.dev/packages/google_maps_flutter [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java index 917d45218345..c3a5ae6a88a0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/main/java/io/flutter/plugins/googlemaps/GoogleMapController.java @@ -10,13 +10,10 @@ import android.content.pm.PackageManager; import android.graphics.Bitmap; import android.graphics.Point; -import android.graphics.SurfaceTexture; import android.os.Bundle; import android.util.Log; -import android.view.TextureView; -import android.view.TextureView.SurfaceTextureListener; +import android.view.Choreographer; import android.view.View; -import android.view.ViewGroup; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; @@ -138,13 +135,61 @@ private CameraPosition getCameraPosition() { return trackCameraPosition ? googleMap.getCameraPosition() : null; } + private boolean loadedCallbackPending = false; + + /** + * Invalidates the map view after the map has finished rendering. + * + *

gmscore GL renderer uses a {@link android.view.TextureView}. Android platform views that are + * displayed as a texture after Flutter v3.0.0. require that the view hierarchy is notified after + * all drawing operations have been flushed. + * + *

Since the GL renderer doesn't use standard Android views, and instead uses GL directly, we + * notify the view hierarchy by invalidating the view. + * + *

Unfortunately, when {@link GoogleMap.OnMapLoadedCallback} is fired, the texture may not have + * been updated yet. + * + *

To workaround this limitation, wait two frames. This ensures that at least the frame budget + * (16.66ms at 60hz) have passed since the drawing operation was issued. + */ + private void invalidateMapIfNeeded() { + if (googleMap == null || loadedCallbackPending) { + return; + } + loadedCallbackPending = true; + googleMap.setOnMapLoadedCallback( + () -> { + loadedCallbackPending = false; + postFrameCallback( + () -> { + postFrameCallback( + () -> { + if (mapView != null) { + mapView.invalidate(); + } + }); + }); + }); + } + + private static void postFrameCallback(Runnable f) { + Choreographer.getInstance() + .postFrameCallback( + new Choreographer.FrameCallback() { + @Override + public void doFrame(long frameTimeNanos) { + f.run(); + } + }); + } + @Override public void onMapReady(GoogleMap googleMap) { this.googleMap = googleMap; this.googleMap.setIndoorEnabled(this.indoorEnabled); this.googleMap.setTrafficEnabled(this.trafficEnabled); this.googleMap.setBuildingsEnabled(this.buildingsEnabled); - installInvalidator(); googleMap.setOnInfoWindowClickListener(this); if (mapReadyResult != null) { mapReadyResult.success(null); @@ -171,71 +216,6 @@ public void onMapReady(GoogleMap googleMap) { } } - // Returns the first TextureView found in the view hierarchy. - private static TextureView findTextureView(ViewGroup group) { - final int n = group.getChildCount(); - for (int i = 0; i < n; i++) { - View view = group.getChildAt(i); - if (view instanceof TextureView) { - return (TextureView) view; - } - if (view instanceof ViewGroup) { - TextureView r = findTextureView((ViewGroup) view); - if (r != null) { - return r; - } - } - } - return null; - } - - private void installInvalidator() { - if (mapView == null) { - // This should only happen in tests. - return; - } - TextureView textureView = findTextureView(mapView); - if (textureView == null) { - Log.i(TAG, "No TextureView found. Likely using the LEGACY renderer."); - return; - } - Log.i(TAG, "Installing custom TextureView driven invalidator."); - SurfaceTextureListener internalListener = textureView.getSurfaceTextureListener(); - // Override the Maps internal SurfaceTextureListener with our own. Our listener - // mostly just invokes the internal listener callbacks but in onSurfaceTextureUpdated - // the mapView is invalidated which ensures that all map updates are presented to the - // screen. - final MapView mapView = this.mapView; - textureView.setSurfaceTextureListener( - new TextureView.SurfaceTextureListener() { - public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { - if (internalListener != null) { - internalListener.onSurfaceTextureAvailable(surface, width, height); - } - } - - public boolean onSurfaceTextureDestroyed(SurfaceTexture surface) { - if (internalListener != null) { - return internalListener.onSurfaceTextureDestroyed(surface); - } - return true; - } - - public void onSurfaceTextureSizeChanged(SurfaceTexture surface, int width, int height) { - if (internalListener != null) { - internalListener.onSurfaceTextureSizeChanged(surface, width, height); - } - } - - public void onSurfaceTextureUpdated(SurfaceTexture surface) { - if (internalListener != null) { - internalListener.onSurfaceTextureUpdated(surface); - } - mapView.invalidate(); - } - }); - } - @Override public void onMethodCall(MethodCall call, MethodChannel.Result result) { switch (call.method) { @@ -329,6 +309,7 @@ public void onSnapshotReady(Bitmap bitmap) { } case "markers#update": { + invalidateMapIfNeeded(); List markersToAdd = call.argument("markersToAdd"); markersController.addMarkers(markersToAdd); List markersToChange = call.argument("markersToChange"); @@ -358,6 +339,7 @@ public void onSnapshotReady(Bitmap bitmap) { } case "polygons#update": { + invalidateMapIfNeeded(); List polygonsToAdd = call.argument("polygonsToAdd"); polygonsController.addPolygons(polygonsToAdd); List polygonsToChange = call.argument("polygonsToChange"); @@ -369,6 +351,7 @@ public void onSnapshotReady(Bitmap bitmap) { } case "polylines#update": { + invalidateMapIfNeeded(); List polylinesToAdd = call.argument("polylinesToAdd"); polylinesController.addPolylines(polylinesToAdd); List polylinesToChange = call.argument("polylinesToChange"); @@ -380,6 +363,7 @@ public void onSnapshotReady(Bitmap bitmap) { } case "circles#update": { + invalidateMapIfNeeded(); List circlesToAdd = call.argument("circlesToAdd"); circlesController.addCircles(circlesToAdd); List circlesToChange = call.argument("circlesToChange"); @@ -459,6 +443,7 @@ public void onSnapshotReady(Bitmap bitmap) { } case "map#setStyle": { + invalidateMapIfNeeded(); boolean mapStyleSet; if (call.arguments instanceof String) { String mapStyle = (String) call.arguments; @@ -481,6 +466,7 @@ public void onSnapshotReady(Bitmap bitmap) { } case "tileOverlays#update": { + invalidateMapIfNeeded(); List> tileOverlaysToAdd = call.argument("tileOverlaysToAdd"); tileOverlaysController.addTileOverlays(tileOverlaysToAdd); List> tileOverlaysToChange = call.argument("tileOverlaysToChange"); @@ -492,6 +478,7 @@ public void onSnapshotReady(Bitmap bitmap) { } case "tileOverlays#clearTileCache": { + invalidateMapIfNeeded(); String tileOverlayId = call.argument("tileOverlayId"); tileOverlaysController.clearTileCache(tileOverlayId); result.success(null); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java index 0b940b9317d7..1ebaa361b21c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java +++ b/packages/google_maps_flutter/google_maps_flutter_android/android/src/test/java/io/flutter/plugins/googlemaps/GoogleMapControllerTest.java @@ -7,24 +7,33 @@ import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import static org.junit.Assert.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import android.content.Context; import android.os.Build; +import android.os.Looper; import androidx.activity.ComponentActivity; import androidx.test.core.app.ApplicationProvider; import com.google.android.gms.maps.GoogleMap; +import com.google.android.gms.maps.MapView; import io.flutter.plugin.common.BinaryMessenger; +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; +import java.util.HashMap; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.robolectric.Robolectric; import org.robolectric.RobolectricTestRunner; +import org.robolectric.Shadows; import org.robolectric.annotation.Config; @RunWith(RobolectricTestRunner.class) @@ -77,6 +86,87 @@ public void OnDestroyReleaseTheMap() throws InterruptedException { assertNull(googleMapController.getView()); } + @Test + public void InvalidateMapAfterMethodCalls() throws InterruptedException { + String[] methodsThatTriggerInvalidation = { + "markers#update", + "polygons#update", + "polylines#update", + "circles#update", + "map#setStyle", + "tileOverlays#update", + "tileOverlays#clearTileCache" + }; + + for (String methodName : methodsThatTriggerInvalidation) { + googleMapController = + new GoogleMapController(0, context, mockMessenger, activity::getLifecycle, null); + googleMapController.init(); + + mockGoogleMap = mock(GoogleMap.class); + googleMapController.onMapReady(mockGoogleMap); + + MethodChannel.Result result = mock(MethodChannel.Result.class); + System.out.println(methodName); + googleMapController.onMethodCall( + new MethodCall(methodName, new HashMap()), result); + + ArgumentCaptor argument = + ArgumentCaptor.forClass(GoogleMap.OnMapLoadedCallback.class); + verify(mockGoogleMap).setOnMapLoadedCallback(argument.capture()); + + MapView mapView = mock(MapView.class); + googleMapController.setView(mapView); + + verify(mapView, never()).invalidate(); + argument.getValue().onMapLoaded(); + Shadows.shadowOf(Looper.getMainLooper()).idle(); + verify(mapView).invalidate(); + } + } + + @Test + public void InvalidateMapOnceAfterMethodCall() throws InterruptedException { + googleMapController.onMapReady(mockGoogleMap); + + MethodChannel.Result result = mock(MethodChannel.Result.class); + googleMapController.onMethodCall( + new MethodCall("markers#update", new HashMap()), result); + googleMapController.onMethodCall( + new MethodCall("polygons#update", new HashMap()), result); + + ArgumentCaptor argument = + ArgumentCaptor.forClass(GoogleMap.OnMapLoadedCallback.class); + verify(mockGoogleMap).setOnMapLoadedCallback(argument.capture()); + + MapView mapView = mock(MapView.class); + googleMapController.setView(mapView); + + verify(mapView, never()).invalidate(); + argument.getValue().onMapLoaded(); + Shadows.shadowOf(Looper.getMainLooper()).idle(); + verify(mapView).invalidate(); + } + + @Test + public void MethodCalledAfterControllerIsDestroyed() throws InterruptedException { + googleMapController.onMapReady(mockGoogleMap); + MethodChannel.Result result = mock(MethodChannel.Result.class); + googleMapController.onMethodCall( + new MethodCall("markers#update", new HashMap()), result); + + ArgumentCaptor argument = + ArgumentCaptor.forClass(GoogleMap.OnMapLoadedCallback.class); + verify(mockGoogleMap).setOnMapLoadedCallback(argument.capture()); + + MapView mapView = mock(MapView.class); + googleMapController.setView(mapView); + googleMapController.onDestroy(activity); + + argument.getValue().onMapLoaded(); + verify(mapView, never()).invalidate(); + } + @Test public void OnMapReadySetsPaddingIfInitialPaddingIsThere() { float padding = 10f; diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/google_maps_flutter/google_maps_flutter_android/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/google_maps_flutter/google_maps_flutter_android/example/lib/readme_excerpts.dart b/packages/google_maps_flutter/google_maps_flutter_android/example/lib/readme_excerpts.dart index 97544420da15..e2864eb3351b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/example/lib/readme_excerpts.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/example/lib/readme_excerpts.dart @@ -14,7 +14,6 @@ void main() { final GoogleMapsFlutterPlatform mapsImplementation = GoogleMapsFlutterPlatform.instance; if (mapsImplementation is GoogleMapsFlutterAndroid) { - // Force Hybrid Composition mode. mapsImplementation.useAndroidViewSurface = true; } // #enddocregion DisplayMode diff --git a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart index 283b4abd38ce..d5a79f3e4a0c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/lib/src/google_maps_flutter_android.dart @@ -503,8 +503,8 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { /// See https://pub.dev/packages/google_maps_flutter_android#display-mode /// for more information. /// - /// Currently defaults to false, but the default is subject to change. - bool useAndroidViewSurface = false; + /// Currently defaults to true, but the default is subject to change. + bool useAndroidViewSurface = true; /// Requests Google Map Renderer with [AndroidMapRenderer] type. /// @@ -610,7 +610,6 @@ class GoogleMapsFlutterAndroid extends GoogleMapsFlutterPlatform { viewType: viewType, onPlatformViewCreated: onPlatformViewCreated, gestureRecognizers: widgetConfiguration.gestureRecognizers, - layoutDirection: widgetConfiguration.textDirection, creationParams: creationParams, creationParamsCodec: const StandardMessageCodec(), ); diff --git a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml index 1ffb8fbbf08b..30c473b2a9f7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_android description: Android implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.6.0 +version: 2.5.3 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart index 1338bdb93d3f..a7b1b9590956 100644 --- a/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_android/test/google_maps_flutter_android_test.dart @@ -158,7 +158,7 @@ void main() { expect(widget, isA()); }); - testWidgets('Defaults to AndroidView', (WidgetTester tester) async { + testWidgets('Defaults to surface view', (WidgetTester tester) async { final GoogleMapsFlutterAndroid maps = GoogleMapsFlutterAndroid(); final Widget widget = maps.buildViewWithConfiguration(1, (int _) {}, @@ -167,7 +167,7 @@ void main() { CameraPosition(target: LatLng(0, 0), zoom: 1), textDirection: TextDirection.ltr)); - expect(widget, isA()); + expect(widget, isA()); }); testWidgets('cloudMapId is passed', (WidgetTester tester) async { @@ -177,7 +177,7 @@ void main() { TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger .setMockMethodCallHandler( SystemChannels.platform_views, - (MethodCall methodCall) async { + (MethodCall methodCall) { if (methodCall.method == 'create') { final Map args = Map.from( methodCall.arguments as Map); @@ -198,7 +198,7 @@ void main() { } } } - return 0; + return null; }, ); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md index 430d1a14d4d7..6cab044e893c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios/CHANGELOG.md @@ -1,6 +1,5 @@ -## 2.3.3 +## NEXT -* Adds support for version 8 of the Google Maps SDK in apps targeting iOS 14+. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 2.3.2 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/integration_test/google_maps_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/integration_test/google_maps_test.dart index 9902456444d6..ef8cab9bd64f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/integration_test/google_maps_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/integration_test/google_maps_test.dart @@ -341,9 +341,7 @@ void main() { expect(coordinate.y, (rect.center.dy - rect.topLeft.dy).round()); await tester.binding.setSurfaceSize(null); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: true); + }); testWidgets('testGetVisibleRegion', (WidgetTester tester) async { final Key key = GlobalKey(); @@ -411,9 +409,7 @@ void main() { expect(firstVisibleRegion, isNot(secondVisibleRegion)); expect(secondVisibleRegion.contains(newCenter), isTrue); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: true); + }); testWidgets('testTraffic', (WidgetTester tester) async { final Key key = GlobalKey(); @@ -703,9 +699,7 @@ void main() { await tester.pumpAndSettle(); zoom = await controller.getZoomLevel(); expect(zoom, equals(7)); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: true); + }); testWidgets('testScreenCoordinate', (WidgetTester tester) async { final Key key = GlobalKey(); @@ -739,9 +733,7 @@ void main() { final ScreenCoordinate topLeft = await controller.getScreenCoordinate(northWest); expect(topLeft, const ScreenCoordinate(x: 0, y: 0)); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: true); + }); testWidgets('testResizeWidget', (WidgetTester tester) async { final Completer controllerCompleter = @@ -849,9 +841,7 @@ void main() { await controllerCompleter.future; final Uint8List? bytes = await controller.takeSnapshot(); expect(bytes?.isNotEmpty, true); - }, - // TODO(stuartmorgan): Re-enable; see https://github.com/flutter/flutter/issues/139825 - skip: true); + }); testWidgets( 'set tileOverlay correctly', diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/ios/Runner.xcodeproj/project.pbxproj b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/ios/Runner.xcodeproj/project.pbxproj index b44e712d259f..0b191c8300c6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/ios/Runner.xcodeproj/project.pbxproj @@ -282,7 +282,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = "The Flutter Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index e271ffe8da9a..a60a46be23c1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios11/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ + +static const NSTimeInterval kWaitTime = 60; + +@interface RunnerUITests : XCTestCase + +@end + +@implementation RunnerUITests + +- (void)testMarkerDraggingCallbacks { + XCUIApplication *application = [[XCUIApplication alloc] init]; + [application launch]; + XCUIElement *placeMarkerButton = application.staticTexts[@"Place marker"]; + if (![placeMarkerButton waitForExistenceWithTimeout:kWaitTime]) { + NSLog(@"application.debugDescription: %@", application.debugDescription); + XCTFail(@"Failed to find the Place marker button."); + } + [placeMarkerButton tap]; + + XCUIElement *Add = application.buttons[@"Add"]; + if (![Add waitForExistenceWithTimeout:kWaitTime]) { + NSLog(@"application.debugDescription: %@", application.debugDescription); + XCTFail(@"Failed to find the Add button."); + } + [Add tap]; + + XCUIElement *marker = application.buttons[@"marker_id_1"]; + if (![marker waitForExistenceWithTimeout:kWaitTime]) { + NSLog(@"application.debugDescription: %@", application.debugDescription); + XCTFail(@"Failed to find the marker."); + } + [marker tap]; + + XCUIElement *toggleDraggable = application.buttons[@"toggle draggable"]; + if (![toggleDraggable waitForExistenceWithTimeout:kWaitTime]) { + NSLog(@"application.debugDescription: %@", application.debugDescription); + XCTFail(@"Failed to find the toggle draggable."); + } + [toggleDraggable tap]; + + // Drag marker to center + [marker pressForDuration:5 thenDragToElement:application]; + + NSPredicate *predicateDragStart = + [NSPredicate predicateWithFormat:@"label CONTAINS[c] %@", @"_onMarkerDragStart"]; + NSPredicate *predicateDrag = + [NSPredicate predicateWithFormat:@"label CONTAINS[c] %@", @"_onMarkerDrag called"]; + NSPredicate *predicateDragEnd = + [NSPredicate predicateWithFormat:@"label CONTAINS[c] %@", @"_onMarkerDragEnd"]; + + XCUIElement *dragStart = [application.staticTexts matchingPredicate:predicateDragStart].element; + if (![dragStart waitForExistenceWithTimeout:kWaitTime]) { + NSLog(@"application.debugDescription: %@", application.debugDescription); + XCTFail(@"Failed to find the _onMarkerDragStart."); + } + XCTAssertTrue(dragStart.exists); + + XCUIElement *drag = [application.staticTexts matchingPredicate:predicateDrag].element; + if (![drag waitForExistenceWithTimeout:kWaitTime]) { + NSLog(@"application.debugDescription: %@", application.debugDescription); + XCTFail(@"Failed to find the _onMarkerDrag."); + } + XCTAssertTrue(drag.exists); + + XCUIElement *dragEnd = [application.staticTexts matchingPredicate:predicateDragEnd].element; + if (![dragEnd waitForExistenceWithTimeout:kWaitTime]) { + NSLog(@"application.debugDescription: %@", application.debugDescription); + XCTFail(@"Failed to find the _onMarkerDragEnd."); + } + XCTAssertTrue(dragEnd.exists); +} + +@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/README.md b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/README.md deleted file mode 100644 index 6856977c1192..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/README.md +++ /dev/null @@ -1,13 +0,0 @@ -# Platform Implementation Test App - -This is a test app for manual testing and automated integration testing -of this platform implementation. It is not intended to demonstrate actual use of -this package, since the intent is that plugin clients use the app-facing -package. - -Unless you are making changes to this implementation package, this example is -very unlikely to be relevant. - -## Versions - -This example requires iOS 13, so will select a 7.x GoogleMaps SDK version. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/2.0x/red_square.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/2.0x/red_square.png deleted file mode 100644 index 0f82237796bf..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/2.0x/red_square.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/3.0x/red_square.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/3.0x/red_square.png deleted file mode 100644 index 7e2739974e7b..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/3.0x/red_square.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/night_mode.json b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/night_mode.json deleted file mode 100644 index 1f16e003a920..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/night_mode.json +++ /dev/null @@ -1,162 +0,0 @@ -[ - { - "elementType": "geometry", - "stylers": [ - { - "color": "#242f3e" - } - ] - }, - { - "elementType": "labels.text.fill", - "stylers": [ - { - "color": "#746855" - } - ] - }, - { - "elementType": "labels.text.stroke", - "stylers": [ - { - "color": "#242f3e" - } - ] - }, - { - "featureType": "administrative.locality", - "elementType": "labels.text.fill", - "stylers": [ - { - "color": "#d59563" - } - ] - }, - { - "featureType": "poi", - "elementType": "labels.text.fill", - "stylers": [ - { - "color": "#d59563" - } - ] - }, - { - "featureType": "poi.park", - "elementType": "geometry", - "stylers": [ - { - "color": "#263c3f" - } - ] - }, - { - "featureType": "poi.park", - "elementType": "labels.text.fill", - "stylers": [ - { - "color": "#6b9a76" - } - ] - }, - { - "featureType": "road", - "elementType": "geometry", - "stylers": [ - { - "color": "#38414e" - } - ] - }, - { - "featureType": "road", - "elementType": "geometry.stroke", - "stylers": [ - { - "color": "#212a37" - } - ] - }, - { - "featureType": "road", - "elementType": "labels.text.fill", - "stylers": [ - { - "color": "#9ca5b3" - } - ] - }, - { - "featureType": "road.highway", - "elementType": "geometry", - "stylers": [ - { - "color": "#746855" - } - ] - }, - { - "featureType": "road.highway", - "elementType": "geometry.stroke", - "stylers": [ - { - "color": "#1f2835" - } - ] - }, - { - "featureType": "road.highway", - "elementType": "labels.text.fill", - "stylers": [ - { - "color": "#f3d19c" - } - ] - }, - { - "featureType": "transit", - "elementType": "geometry", - "stylers": [ - { - "color": "#2f3948" - } - ] - }, - { - "featureType": "transit.station", - "elementType": "labels.text.fill", - "stylers": [ - { - "color": "#d59563" - } - ] - }, - { - "featureType": "water", - "elementType": "geometry", - "stylers": [ - { - "color": "#17263c" - } - ] - }, - { - "featureType": "water", - "elementType": "labels.text.fill", - "stylers": [ - { - "color": "#515c6d" - } - ] - }, - { - "featureType": "water", - "elementType": "labels.text.stroke", - "stylers": [ - { - "color": "#17263c" - } - ] - } -] - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/red_square.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/red_square.png deleted file mode 100644 index 650a2dee711d..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/assets/red_square.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/AppFrameworkInfo.plist b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 1f6b98f117b2..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,30 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - UIRequiredDeviceCapabilities - - arm64 - - MinimumOSVersion - 13.0 - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/Debug.xcconfig b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/Debug.xcconfig deleted file mode 100644 index e8efba114687..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/Release.xcconfig b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/Release.xcconfig deleted file mode 100644 index 399e9340e6f6..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Podfile b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Podfile deleted file mode 100644 index 2a299b472947..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Podfile +++ /dev/null @@ -1,46 +0,0 @@ -# Uncomment this line to define a global platform for your project -platform :ios, '14.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - - pod 'OCMock', '~> 3.9.1' - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - target.build_configurations.each do |build_configuration| - build_configuration.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64 i386' - end - end -end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/project.pbxproj b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 79b09284321a..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,666 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 4510D964F3B1259FEDD3ABA6 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 7755F8F4BABC3D6A0BD4048B /* libPods-Runner.a */; }; - 68E4726A2836FF0C00BDDDAC /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 68E472692836FF0C00BDDDAC /* MapKit.framework */; }; - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; - 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - 982F2A6C27BADE17003C81F4 /* PartiallyMockedMapView.m in Sources */ = {isa = PBXBuildFile; fileRef = 982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */; }; - F7151F13265D7ED70028CB91 /* GoogleMapsTests.m in Sources */ = {isa = PBXBuildFile; fileRef = F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */; }; - FC8F35FC8CD533B128950487 /* libPods-RunnerTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F267F68029D1A4E2E4C572A7 /* libPods-RunnerTests.a */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - F7151F15265D7ED70028CB91 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 97C146ED1CF9000F007C117D; - remoteInfo = Runner; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 68E472692836FF0C00BDDDAC /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/iOSSupport/System/Library/Frameworks/MapKit.framework; sourceTree = DEVELOPER_DIR; }; - 733AFAB37683A9DA7512F09C /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 7755F8F4BABC3D6A0BD4048B /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 982F2A6A27BADE17003C81F4 /* PartiallyMockedMapView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PartiallyMockedMapView.h; sourceTree = ""; }; - 982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PartiallyMockedMapView.m; sourceTree = ""; }; - B7AFC65E3DD5AC60D834D83D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - E52C6A6210A56F027C582EF9 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - EA0E91726245EDC22B97E8B9 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - F267F68029D1A4E2E4C572A7 /* libPods-RunnerTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RunnerTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - F7151F10265D7ED70028CB91 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoogleMapsTests.m; sourceTree = ""; }; - F7151F14265D7ED70028CB91 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4510D964F3B1259FEDD3ABA6 /* libPods-Runner.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F7151F0D265D7ED70028CB91 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 68E4726A2836FF0C00BDDDAC /* MapKit.framework in Frameworks */, - FC8F35FC8CD533B128950487 /* libPods-RunnerTests.a in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1E7CF0857EFC88FC263CF3B2 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 68E472692836FF0C00BDDDAC /* MapKit.framework */, - 7755F8F4BABC3D6A0BD4048B /* libPods-Runner.a */, - F267F68029D1A4E2E4C572A7 /* libPods-RunnerTests.a */, - ); - name = Frameworks; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - F7151F11265D7ED70028CB91 /* RunnerTests */, - 97C146EF1CF9000F007C117D /* Products */, - A189CFE5474BF8A07908B2E0 /* Pods */, - 1E7CF0857EFC88FC263CF3B2 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - F7151F10265D7ED70028CB91 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, - 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 97C146F11CF9000F007C117D /* Supporting Files */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - ); - path = Runner; - sourceTree = ""; - }; - 97C146F11CF9000F007C117D /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 97C146F21CF9000F007C117D /* main.m */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - A189CFE5474BF8A07908B2E0 /* Pods */ = { - isa = PBXGroup; - children = ( - B7AFC65E3DD5AC60D834D83D /* Pods-Runner.debug.xcconfig */, - EA0E91726245EDC22B97E8B9 /* Pods-Runner.release.xcconfig */, - E52C6A6210A56F027C582EF9 /* Pods-RunnerTests.debug.xcconfig */, - 733AFAB37683A9DA7512F09C /* Pods-RunnerTests.release.xcconfig */, - ); - name = Pods; - sourceTree = ""; - }; - F7151F11265D7ED70028CB91 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */, - 982F2A6A27BADE17003C81F4 /* PartiallyMockedMapView.h */, - 982F2A6B27BADE17003C81F4 /* PartiallyMockedMapView.m */, - F7151F14265D7ED70028CB91 /* Info.plist */, - ); - path = RunnerTests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 74BF216DF17B0C7F983459BD /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - BB6BD9A1101E970BEF85B6D2 /* [CP] Copy Pods Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; - F7151F0F265D7ED70028CB91 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = F7151F19265D7ED70028CB91 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - D067548A17DC238B80D2BD12 /* [CP] Check Pods Manifest.lock */, - F7151F0C265D7ED70028CB91 /* Sources */, - F7151F0D265D7ED70028CB91 /* Frameworks */, - F7151F0E265D7ED70028CB91 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - F7151F16265D7ED70028CB91 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = F7151F10265D7ED70028CB91 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1430; - ORGANIZATIONNAME = "The Flutter Authors"; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - }; - F7151F0F265D7ED70028CB91 = { - CreatedOnToolsVersion = 12.5; - ProvisioningStyle = Automatic; - TestTargetID = 97C146ED1CF9000F007C117D; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - F7151F0F265D7ED70028CB91 /* RunnerTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F7151F0E265D7ED70028CB91 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 74BF216DF17B0C7F983459BD /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - BB6BD9A1101E970BEF85B6D2 /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh", - "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64/GoogleMaps.framework/Resources/GoogleMaps.bundle", - "${PODS_ROOT}/GoogleMaps/Maps/Frameworks/GoogleMaps.xcframework/ios-arm64_x86_64-simulator/GoogleMaps.framework/Resources/GoogleMaps.bundle", - ); - name = "[CP] Copy Pods Resources"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/GoogleMaps.bundle", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - D067548A17DC238B80D2BD12 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, - 97C146F31CF9000F007C117D /* main.m in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F7151F0C265D7ED70028CB91 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F7151F13265D7ED70028CB91 /* GoogleMapsTests.m in Sources */, - 982F2A6C27BADE17003C81F4 /* PartiallyMockedMapView.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - F7151F16265D7ED70028CB91 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 97C146ED1CF9000F007C117D /* Runner */; - targetProxy = F7151F15265D7ED70028CB91 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.googleMobileMapsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64"; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Flutter", - ); - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.googleMobileMapsExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - F7151F17265D7ED70028CB91 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = E52C6A6210A56F027C582EF9 /* Pods-RunnerTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64"; - INFOPLIST_FILE = RunnerTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner"; - }; - name = Debug; - }; - F7151F18265D7ED70028CB91 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 733AFAB37683A9DA7512F09C /* Pods-RunnerTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_STYLE = Automatic; - "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386 arm64"; - INFOPLIST_FILE = RunnerTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F7151F19265D7ED70028CB91 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F7151F17265D7ED70028CB91 /* Debug */, - F7151F18265D7ED70028CB91 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index e271ffe8da9a..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/AppDelegate.h b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/AppDelegate.h deleted file mode 100644 index 9bc6c56e34f9..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/AppDelegate.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import - -@interface AppDelegate : FlutterAppDelegate -@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/AppDelegate.m b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/AppDelegate.m deleted file mode 100644 index 55733442b4cf..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/AppDelegate.m +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "AppDelegate.h" -#import "GeneratedPluginRegistrant.h" - -@import GoogleMaps; - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application - didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - // Provide the GoogleMaps API key. - NSString *mapsApiKey = [[NSProcessInfo processInfo] environment][@"MAPS_API_KEY"]; - if ([mapsApiKey length] == 0) { - mapsApiKey = @"YOUR KEY HERE"; - } - [GMSServices provideAPIKey:mapsApiKey]; - - // Register Flutter plugins. - [GeneratedPluginRegistrant registerWithRegistry:self]; - - return [super application:application didFinishLaunchingWithOptions:launchOptions]; -} - -@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index 3d43d11e66f4..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf03016f..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b0bca8..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde12118dda..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e7edb8..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc2306c285..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd967d96..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8f5cee..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b8609df0..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d164a5a9..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d39da7..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41e14e2..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f5853602..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725b70f1..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Base.lproj/Main.storyboard b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Info.plist b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Info.plist deleted file mode 100644 index 818c2430b09f..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/Info.plist +++ /dev/null @@ -1,53 +0,0 @@ - - - - - CADisableMinimumFrameDurationOnPhone - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - google_maps_flutter_example - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSLocationWhenInUseUsageDescription - This app needs your location to test the location feature of the Google Maps plugin. - UIApplicationSupportsIndirectInputEvents - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UIRequiredDeviceCapabilities - - arm64 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/main.m b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/main.m deleted file mode 100644 index f143297b30d6..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner/main.m +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import -#import -#import "AppDelegate.h" - -int main(int argc, char *argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/GoogleMapsTests.m b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/GoogleMapsTests.m deleted file mode 100644 index 8da526629087..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/GoogleMapsTests.m +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import google_maps_flutter_ios; -@import google_maps_flutter_ios.Test; -@import XCTest; -@import GoogleMaps; - -#import -#import "PartiallyMockedMapView.h" - -@interface FLTGoogleMapFactory (Test) -@property(strong, nonatomic, readonly) id sharedMapServices; -@end - -@interface GoogleMapsTests : XCTestCase -@end - -@implementation GoogleMapsTests - -- (void)testPlugin { - FLTGoogleMapsPlugin *plugin = [[FLTGoogleMapsPlugin alloc] init]; - XCTAssertNotNil(plugin); -} - -- (void)testFrameObserver { - id registrar = OCMProtocolMock(@protocol(FlutterPluginRegistrar)); - CGRect frame = CGRectMake(0, 0, 100, 100); -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - // TODO(stuartmorgan): Switch to initWithOptions: once we can guarantee we will be using SDK 8.3+. - // That API was only added in 8.3, and Cocoapod caches on some machines may not be up-to-date - // enough to resolve to that yet even when targeting iOS 14+. - PartiallyMockedMapView *mapView = [[PartiallyMockedMapView alloc] - initWithFrame:frame - camera:[[GMSCameraPosition alloc] initWithLatitude:0 longitude:0 zoom:0]]; -#pragma clang diagnostic pop - FLTGoogleMapController *controller = [[FLTGoogleMapController alloc] initWithMapView:mapView - viewIdentifier:0 - arguments:nil - registrar:registrar]; - - for (NSInteger i = 0; i < 10; ++i) { - [controller view]; - } - XCTAssertEqual(mapView.frameObserverCount, 1); - - mapView.frame = frame; - XCTAssertEqual(mapView.frameObserverCount, 0); -} - -- (void)testMapsServiceSync { - id registrar = OCMProtocolMock(@protocol(FlutterPluginRegistrar)); - FLTGoogleMapFactory *factory1 = [[FLTGoogleMapFactory alloc] initWithRegistrar:registrar]; - XCTAssertNotNil(factory1.sharedMapServices); - FLTGoogleMapFactory *factory2 = [[FLTGoogleMapFactory alloc] initWithRegistrar:registrar]; - // Test pointer equality, should be same retained singleton +[GMSServices sharedServices] object. - // Retaining the opaque object should be enough to avoid multiple internal initializations, - // but don't test the internals of the GoogleMaps API. Assume that it does what is documented. - // https://developers.google.com/maps/documentation/ios-sdk/reference/interface_g_m_s_services#a436e03c32b1c0be74e072310a7158831 - XCTAssertEqual(factory1.sharedMapServices, factory2.sharedMapServices); -} - -@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/Info.plist b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/Info.plist deleted file mode 100644 index 64d65ca49577..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/PartiallyMockedMapView.h b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/PartiallyMockedMapView.h deleted file mode 100644 index 4288401cf90d..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/PartiallyMockedMapView.h +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import GoogleMaps; - -/** - * Defines a map view used for testing key-value observing. - */ -@interface PartiallyMockedMapView : GMSMapView - -/** - * The number of times that the `frame` KVO has been added. - */ -@property(nonatomic, assign, readonly) NSInteger frameObserverCount; - -@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/PartiallyMockedMapView.m b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/PartiallyMockedMapView.m deleted file mode 100644 index 202a18d128c0..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/RunnerTests/PartiallyMockedMapView.m +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "PartiallyMockedMapView.h" - -@interface PartiallyMockedMapView () - -@property(nonatomic, assign) NSInteger frameObserverCount; - -@end - -@implementation PartiallyMockedMapView - -- (void)addObserver:(NSObject *)observer - forKeyPath:(NSString *)keyPath - options:(NSKeyValueObservingOptions)options - context:(void *)context { - [super addObserver:observer forKeyPath:keyPath options:options context:context]; - - if ([keyPath isEqualToString:@"frame"]) { - ++self.frameObserverCount; - } -} - -- (void)removeObserver:(NSObject *)observer forKeyPath:(NSString *)keyPath { - [super removeObserver:observer forKeyPath:keyPath]; - - if ([keyPath isEqualToString:@"frame"]) { - --self.frameObserverCount; - } -} - -@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/lib/main.dart b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/lib/main.dart deleted file mode 100644 index 09fa814fdcf8..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/lib/main.dart +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:maps_example_dart/animate_camera.dart'; -import 'package:maps_example_dart/lite_mode.dart'; -import 'package:maps_example_dart/map_click.dart'; -import 'package:maps_example_dart/map_coordinates.dart'; -import 'package:maps_example_dart/map_map_id.dart'; -import 'package:maps_example_dart/map_ui.dart'; -import 'package:maps_example_dart/maps_demo.dart'; -import 'package:maps_example_dart/marker_icons.dart'; -import 'package:maps_example_dart/move_camera.dart'; -import 'package:maps_example_dart/padding.dart'; -import 'package:maps_example_dart/page.dart'; -import 'package:maps_example_dart/place_circle.dart'; -import 'package:maps_example_dart/place_marker.dart'; -import 'package:maps_example_dart/place_polygon.dart'; -import 'package:maps_example_dart/place_polyline.dart'; -import 'package:maps_example_dart/scrolling_map.dart'; -import 'package:maps_example_dart/snapshot.dart'; -import 'package:maps_example_dart/tile_overlay.dart'; - -void main() { - runApp(const MaterialApp( - home: MapsDemo([ - MapUiPage(), - MapCoordinatesPage(), - MapClickPage(), - AnimateCameraPage(), - MoveCameraPage(), - PlaceMarkerPage(), - MarkerIconsPage(), - ScrollingMapPage(), - PlacePolylinePage(), - PlacePolygonPage(), - PlaceCirclePage(), - PaddingPage(), - SnapshotPage(), - LiteModePage(), - TileOverlayPage(), - MapIdPage(), - ]))); -} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml deleted file mode 100644 index db7f296ff9c4..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/pubspec.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: google_maps_flutter_example -description: Demonstrates how to use the google_maps_flutter plugin. -publish_to: none - -environment: - sdk: ">=3.0.0 <4.0.0" - flutter: ">=3.10.0" - -dependencies: - cupertino_icons: ^1.0.5 - flutter: - sdk: flutter - flutter_plugin_android_lifecycle: ^2.0.1 - google_maps_flutter_ios: - # When depending on this package from a real application you should use: - # google_maps_flutter_ios: ^x.y.z - # See https://dart.dev/tools/pub/dependencies#version-constraints - # The example app is bundled with the plugin so we use a path dependency on - # the parent directory to use the current plugin's version. - path: ../../ - google_maps_flutter_platform_interface: ^2.4.0 - maps_example_dart: - path: ../shared/maps_example_dart/ - -dev_dependencies: - flutter_test: - sdk: flutter - integration_test: - sdk: flutter - -flutter: - uses-material-design: true - assets: - - assets/ diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m index 8619d8908fba..904020e3fc14 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.m @@ -89,18 +89,11 @@ - (instancetype)initWithFrame:(CGRect)frame } } -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - // TODO(stuartmorgan): Switch to initWithOptions: once versions older than - // iOS 14 are no longer supported by the plugin, or there is a specific need - // for its functionality. Since it involves a newly-added class, call it - // dynamically is more trouble than it is currently worth. if (mapID && [GMSMapView respondsToSelector:@selector(mapWithFrame:mapID:camera:)]) { mapView = [GMSMapView mapWithFrame:frame mapID:mapID camera:camera]; } else { mapView = [GMSMapView mapWithFrame:frame camera:camera]; } -#pragma clang diagnostic pop return [self initWithMapView:mapView viewIdentifier:viewId arguments:args registrar:registrar]; } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec b/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec index e731efeaa9b1..e8d7485ce19c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec +++ b/packages/google_maps_flutter/google_maps_flutter_ios/ios/google_maps_flutter_ios.podspec @@ -21,7 +21,7 @@ Downloaded by pub (not CocoaPods). # Allow any version up to the next breaking change after the latest version that # has been confirmed to be compatible via an example in examples/. See discussion # in https://github.com/flutter/flutter/issues/86820 for why this is so broad. - s.dependency 'GoogleMaps', '< 9.0' + s.dependency 'GoogleMaps', '< 8.0' s.static_framework = true s.platform = :ios, '11.0' # GoogleMaps does not support arm64 simulators. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml index 9b2e69044fed..28a51aa20aa0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_ios description: iOS implementation of the google_maps_flutter plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.3.3 +version: 2.3.2 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml index 820f4d008639..2304d13037d4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_platform_interface/pubspec.yaml @@ -21,7 +21,7 @@ dev_dependencies: async: ^2.5.0 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - google-maps diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.mocks.dart b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.mocks.dart index 0b3778118f87..f73b3d734afa 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.mocks.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_controller_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in google_maps_flutter_web_integration_tests/integration_test/google_maps_controller_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:google_maps/google_maps.dart' as _i2; import 'package:google_maps_flutter_platform_interface/google_maps_flutter_platform_interface.dart' @@ -13,8 +15,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -42,7 +42,6 @@ class MockCirclesController extends _i1.Mock implements _i3.CirclesController { returnValue: <_i4.CircleId, _i3.CircleController>{}, returnValueForMissingStub: <_i4.CircleId, _i3.CircleController>{}, ) as Map<_i4.CircleId, _i3.CircleController>); - @override _i2.GMap get googleMap => (super.noSuchMethod( Invocation.getter(#googleMap), @@ -55,7 +54,6 @@ class MockCirclesController extends _i1.Mock implements _i3.CirclesController { Invocation.getter(#googleMap), ), ) as _i2.GMap); - @override set googleMap(_i2.GMap? _googleMap) => super.noSuchMethod( Invocation.setter( @@ -64,14 +62,12 @@ class MockCirclesController extends _i1.Mock implements _i3.CirclesController { ), returnValueForMissingStub: null, ); - @override int get mapId => (super.noSuchMethod( Invocation.getter(#mapId), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override set mapId(int? _mapId) => super.noSuchMethod( Invocation.setter( @@ -80,7 +76,6 @@ class MockCirclesController extends _i1.Mock implements _i3.CirclesController { ), returnValueForMissingStub: null, ); - @override void addCircles(Set<_i4.Circle>? circlesToAdd) => super.noSuchMethod( Invocation.method( @@ -89,7 +84,6 @@ class MockCirclesController extends _i1.Mock implements _i3.CirclesController { ), returnValueForMissingStub: null, ); - @override void changeCircles(Set<_i4.Circle>? circlesToChange) => super.noSuchMethod( Invocation.method( @@ -98,7 +92,6 @@ class MockCirclesController extends _i1.Mock implements _i3.CirclesController { ), returnValueForMissingStub: null, ); - @override void removeCircles(Set<_i4.CircleId>? circleIdsToRemove) => super.noSuchMethod( @@ -108,7 +101,6 @@ class MockCirclesController extends _i1.Mock implements _i3.CirclesController { ), returnValueForMissingStub: null, ); - @override void bindToMap( int? mapId, @@ -137,7 +129,6 @@ class MockPolygonsController extends _i1.Mock returnValue: <_i4.PolygonId, _i3.PolygonController>{}, returnValueForMissingStub: <_i4.PolygonId, _i3.PolygonController>{}, ) as Map<_i4.PolygonId, _i3.PolygonController>); - @override _i2.GMap get googleMap => (super.noSuchMethod( Invocation.getter(#googleMap), @@ -150,7 +141,6 @@ class MockPolygonsController extends _i1.Mock Invocation.getter(#googleMap), ), ) as _i2.GMap); - @override set googleMap(_i2.GMap? _googleMap) => super.noSuchMethod( Invocation.setter( @@ -159,14 +149,12 @@ class MockPolygonsController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override int get mapId => (super.noSuchMethod( Invocation.getter(#mapId), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override set mapId(int? _mapId) => super.noSuchMethod( Invocation.setter( @@ -175,7 +163,6 @@ class MockPolygonsController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void addPolygons(Set<_i4.Polygon>? polygonsToAdd) => super.noSuchMethod( Invocation.method( @@ -184,7 +171,6 @@ class MockPolygonsController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void changePolygons(Set<_i4.Polygon>? polygonsToChange) => super.noSuchMethod( Invocation.method( @@ -193,7 +179,6 @@ class MockPolygonsController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void removePolygons(Set<_i4.PolygonId>? polygonIdsToRemove) => super.noSuchMethod( @@ -203,7 +188,6 @@ class MockPolygonsController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void bindToMap( int? mapId, @@ -232,7 +216,6 @@ class MockPolylinesController extends _i1.Mock returnValue: <_i4.PolylineId, _i3.PolylineController>{}, returnValueForMissingStub: <_i4.PolylineId, _i3.PolylineController>{}, ) as Map<_i4.PolylineId, _i3.PolylineController>); - @override _i2.GMap get googleMap => (super.noSuchMethod( Invocation.getter(#googleMap), @@ -245,7 +228,6 @@ class MockPolylinesController extends _i1.Mock Invocation.getter(#googleMap), ), ) as _i2.GMap); - @override set googleMap(_i2.GMap? _googleMap) => super.noSuchMethod( Invocation.setter( @@ -254,14 +236,12 @@ class MockPolylinesController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override int get mapId => (super.noSuchMethod( Invocation.getter(#mapId), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override set mapId(int? _mapId) => super.noSuchMethod( Invocation.setter( @@ -270,7 +250,6 @@ class MockPolylinesController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void addPolylines(Set<_i4.Polyline>? polylinesToAdd) => super.noSuchMethod( Invocation.method( @@ -279,7 +258,6 @@ class MockPolylinesController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void changePolylines(Set<_i4.Polyline>? polylinesToChange) => super.noSuchMethod( @@ -289,7 +267,6 @@ class MockPolylinesController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void removePolylines(Set<_i4.PolylineId>? polylineIdsToRemove) => super.noSuchMethod( @@ -299,7 +276,6 @@ class MockPolylinesController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void bindToMap( int? mapId, @@ -327,7 +303,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { returnValue: <_i4.MarkerId, _i3.MarkerController>{}, returnValueForMissingStub: <_i4.MarkerId, _i3.MarkerController>{}, ) as Map<_i4.MarkerId, _i3.MarkerController>); - @override _i2.GMap get googleMap => (super.noSuchMethod( Invocation.getter(#googleMap), @@ -340,7 +315,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { Invocation.getter(#googleMap), ), ) as _i2.GMap); - @override set googleMap(_i2.GMap? _googleMap) => super.noSuchMethod( Invocation.setter( @@ -349,14 +323,12 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { ), returnValueForMissingStub: null, ); - @override int get mapId => (super.noSuchMethod( Invocation.getter(#mapId), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override set mapId(int? _mapId) => super.noSuchMethod( Invocation.setter( @@ -365,7 +337,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { ), returnValueForMissingStub: null, ); - @override void addMarkers(Set<_i4.Marker>? markersToAdd) => super.noSuchMethod( Invocation.method( @@ -374,7 +345,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { ), returnValueForMissingStub: null, ); - @override void changeMarkers(Set<_i4.Marker>? markersToChange) => super.noSuchMethod( Invocation.method( @@ -383,7 +353,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { ), returnValueForMissingStub: null, ); - @override void removeMarkers(Set<_i4.MarkerId>? markerIdsToRemove) => super.noSuchMethod( @@ -393,7 +362,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { ), returnValueForMissingStub: null, ); - @override void showMarkerInfoWindow(_i4.MarkerId? markerId) => super.noSuchMethod( Invocation.method( @@ -402,7 +370,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { ), returnValueForMissingStub: null, ); - @override void hideMarkerInfoWindow(_i4.MarkerId? markerId) => super.noSuchMethod( Invocation.method( @@ -411,7 +378,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { ), returnValueForMissingStub: null, ); - @override bool isInfoWindowShown(_i4.MarkerId? markerId) => (super.noSuchMethod( Invocation.method( @@ -421,7 +387,6 @@ class MockMarkersController extends _i1.Mock implements _i3.MarkersController { returnValue: false, returnValueForMissingStub: false, ) as bool); - @override void bindToMap( int? mapId, @@ -456,7 +421,6 @@ class MockTileOverlaysController extends _i1.Mock Invocation.getter(#googleMap), ), ) as _i2.GMap); - @override set googleMap(_i2.GMap? _googleMap) => super.noSuchMethod( Invocation.setter( @@ -465,33 +429,15 @@ class MockTileOverlaysController extends _i1.Mock ), returnValueForMissingStub: null, ); - - @override - int get mapId => (super.noSuchMethod( - Invocation.getter(#mapId), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); - @override - set mapId(int? _mapId) => super.noSuchMethod( - Invocation.setter( - #mapId, - _mapId, - ), - returnValueForMissingStub: null, - ); - - @override - void addTileOverlays(Set<_i4.TileOverlay>? tileOverlaysToAdd) => + void addTileOverlays(Set<_i4.TileOverlay>? tileOverlays) => super.noSuchMethod( Invocation.method( #addTileOverlays, - [tileOverlaysToAdd], + [tileOverlays], ), returnValueForMissingStub: null, ); - @override void changeTileOverlays(Set<_i4.TileOverlay>? tileOverlays) => super.noSuchMethod( @@ -501,7 +447,6 @@ class MockTileOverlaysController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void removeTileOverlays(Set<_i4.TileOverlayId>? tileOverlayIds) => super.noSuchMethod( @@ -511,7 +456,6 @@ class MockTileOverlaysController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void clearTileCache(_i4.TileOverlayId? tileOverlayId) => super.noSuchMethod( Invocation.method( @@ -520,20 +464,4 @@ class MockTileOverlaysController extends _i1.Mock ), returnValueForMissingStub: null, ); - - @override - void bindToMap( - int? mapId, - _i2.GMap? googleMap, - ) => - super.noSuchMethod( - Invocation.method( - #bindToMap, - [ - mapId, - googleMap, - ], - ), - returnValueForMissingStub: null, - ); } diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.mocks.dart b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.mocks.dart index b26942d84fa0..831bda161e84 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.mocks.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/google_maps_plugin_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in google_maps_flutter_web_integration_tests/integration_test/google_maps_plugin_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -15,8 +17,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -94,7 +94,6 @@ class MockGoogleMapController extends _i1.Mock Invocation.getter(#configuration), ), ) as _i2.MapConfiguration); - @override _i3.StreamController<_i2.MapEvent> get stream => (super.noSuchMethod( Invocation.getter(#stream), @@ -108,21 +107,18 @@ class MockGoogleMapController extends _i1.Mock Invocation.getter(#stream), ), ) as _i3.StreamController<_i2.MapEvent>); - @override _i3.Stream<_i2.MapEvent> get events => (super.noSuchMethod( Invocation.getter(#events), returnValue: _i3.Stream<_i2.MapEvent>.empty(), returnValueForMissingStub: _i3.Stream<_i2.MapEvent>.empty(), ) as _i3.Stream<_i2.MapEvent>); - @override bool get isInitialized => (super.noSuchMethod( Invocation.getter(#isInitialized), returnValue: false, returnValueForMissingStub: false, ) as bool); - @override void debugSetOverrides({ _i4.DebugCreateMapFunction? createMap, @@ -147,7 +143,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void init() => super.noSuchMethod( Invocation.method( @@ -156,7 +151,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void updateMapConfiguration(_i2.MapConfiguration? update) => super.noSuchMethod( @@ -166,7 +160,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void updateStyles(List<_i5.MapTypeStyle>? styles) => super.noSuchMethod( Invocation.method( @@ -175,7 +168,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i3.Future<_i2.LatLngBounds> getVisibleRegion() => (super.noSuchMethod( Invocation.method( @@ -198,7 +190,6 @@ class MockGoogleMapController extends _i1.Mock ), )), ) as _i3.Future<_i2.LatLngBounds>); - @override _i3.Future<_i2.ScreenCoordinate> getScreenCoordinate(_i2.LatLng? latLng) => (super.noSuchMethod( @@ -223,7 +214,6 @@ class MockGoogleMapController extends _i1.Mock ), )), ) as _i3.Future<_i2.ScreenCoordinate>); - @override _i3.Future<_i2.LatLng> getLatLng(_i2.ScreenCoordinate? screenCoordinate) => (super.noSuchMethod( @@ -246,7 +236,6 @@ class MockGoogleMapController extends _i1.Mock ), )), ) as _i3.Future<_i2.LatLng>); - @override _i3.Future moveCamera(_i2.CameraUpdate? cameraUpdate) => (super.noSuchMethod( @@ -257,7 +246,6 @@ class MockGoogleMapController extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future getZoomLevel() => (super.noSuchMethod( Invocation.method( @@ -267,7 +255,6 @@ class MockGoogleMapController extends _i1.Mock returnValue: _i3.Future.value(0.0), returnValueForMissingStub: _i3.Future.value(0.0), ) as _i3.Future); - @override void updateCircles(_i2.CircleUpdates? updates) => super.noSuchMethod( Invocation.method( @@ -276,7 +263,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void updatePolygons(_i2.PolygonUpdates? updates) => super.noSuchMethod( Invocation.method( @@ -285,7 +271,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void updatePolylines(_i2.PolylineUpdates? updates) => super.noSuchMethod( Invocation.method( @@ -294,7 +279,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void updateMarkers(_i2.MarkerUpdates? updates) => super.noSuchMethod( Invocation.method( @@ -303,7 +287,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void updateTileOverlays(Set<_i2.TileOverlay>? newOverlays) => super.noSuchMethod( @@ -313,7 +296,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void clearTileCache(_i2.TileOverlayId? id) => super.noSuchMethod( Invocation.method( @@ -322,7 +304,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void showInfoWindow(_i2.MarkerId? markerId) => super.noSuchMethod( Invocation.method( @@ -331,7 +312,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void hideInfoWindow(_i2.MarkerId? markerId) => super.noSuchMethod( Invocation.method( @@ -340,7 +320,6 @@ class MockGoogleMapController extends _i1.Mock ), returnValueForMissingStub: null, ); - @override bool isInfoWindowShown(_i2.MarkerId? markerId) => (super.noSuchMethod( Invocation.method( @@ -350,7 +329,6 @@ class MockGoogleMapController extends _i1.Mock returnValue: false, returnValueForMissingStub: false, ) as bool); - @override void dispose() => super.noSuchMethod( Invocation.method( diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/overlays_test.mocks.dart b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/overlays_test.mocks.dart index 4e4bc2666c3f..126f7c5dc77a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/overlays_test.mocks.dart +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/integration_test/overlays_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in google_maps_flutter_web_integration_tests/integration_test/overlays_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -13,8 +15,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml index 1f9f37f8ccc1..9f12257f8c82 100644 --- a/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_web/example/pubspec.yaml @@ -22,7 +22,7 @@ dev_dependencies: http: ">=0.13.0 <2.0.0" integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 dependency_overrides: # Override the google_maps_flutter dependency on google_maps_flutter_web. diff --git a/packages/google_sign_in/google_sign_in/CHANGELOG.md b/packages/google_sign_in/google_sign_in/CHANGELOG.md index a010d955f9bf..e18b832ab9e3 100644 --- a/packages/google_sign_in/google_sign_in/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in/CHANGELOG.md @@ -1,11 +1,6 @@ -## 6.2.1 +## NEXT -* Improves README example and updates it to use code excerpts. - -## 6.2.0 - -* Adds support for macOS. -* Updates minimum supported SDK version to Flutter 3.16. +* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 6.1.6 diff --git a/packages/google_sign_in/google_sign_in/README.md b/packages/google_sign_in/google_sign_in/README.md index 1b94f5d069dd..87f285718058 100644 --- a/packages/google_sign_in/google_sign_in/README.md +++ b/packages/google_sign_in/google_sign_in/README.md @@ -2,9 +2,9 @@ A Flutter plugin for [Google Sign In](https://developers.google.com/identity/). -| | Android | iOS | macOS | Web | -|-------------|---------|-------|--------|-----| -| **Support** | SDK 16+ | 11.0+ | 10.15+ | Any | +| | Android | iOS | Web | +|-------------|---------|---------|-----| +| **Support** | SDK 16+ | iOS 11+ | Any | ## Platform integration @@ -42,10 +42,6 @@ The Flutter Favorite [sign_in_with_apple](https://pub.dev/packages/sign_in_with_apple) plugin could be an option. -### macOS integration - -Please see [instructions on integrating Google Sign-In for macOS](https://pub.dev/packages/google_sign_in_ios#macos-setup). - ### Web integration The new SDK used by the web has fully separated Authentication from Authorization, @@ -68,19 +64,20 @@ To use this plugin, follow the ### Use the plugin -Initialize `GoogleSignIn` with the scopes you want: +Add the following import to your Dart code: - ```dart -const List scopes = [ - 'email', - 'https://www.googleapis.com/auth/contacts.readonly', -]; +import 'package:google_sign_in/google_sign_in.dart'; +``` +Initialize `GoogleSignIn` with the scopes you want: + +```dart GoogleSignIn _googleSignIn = GoogleSignIn( - // Optional clientId - // clientId: 'your-client_id.apps.googleusercontent.com', - scopes: scopes, + scopes: [ + 'email', + 'https://www.googleapis.com/auth/contacts.readonly', + ], ); ``` @@ -88,7 +85,6 @@ GoogleSignIn _googleSignIn = GoogleSignIn( You can now use the `GoogleSignIn` class to authenticate in your Dart code, e.g. - ```dart Future _handleSignIn() async { try { @@ -122,14 +118,8 @@ Applications must be able to: There's a new method that enables the checks above, `canAccessScopes`: - ```dart -// In mobile, being authenticated means being authorized... -bool isAuthorized = account != null; -// However, on web... -if (kIsWeb && account != null) { - isAuthorized = await _googleSignIn.canAccessScopes(scopes); -} +final bool isAuthorized = await _googleSignIn.canAccessScopes(scopes); ``` _(Only implemented in the web platform, from version 6.1.0 of this package)_ @@ -140,13 +130,14 @@ If an app determines that the user hasn't granted the scopes it requires, it should initiate an Authorization request. (Remember that in the web platform, this request **must be initiated from an user interaction**, like a button press). - ```dart Future _handleAuthorizeScopes() async { final bool isAuthorized = await _googleSignIn.requestScopes(scopes); if (isAuthorized) { - unawaited(_handleGetContact(_currentUser!)); + // Do things that only authorized users can do! + _handleGetContact(_currentUser!); } +} ``` The `requestScopes` returns a `boolean` value that is `true` if the user has diff --git a/packages/google_sign_in/google_sign_in/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/google_sign_in/google_sign_in/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/google_sign_in/google_sign_in/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/google_sign_in/google_sign_in/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/google_sign_in/google_sign_in/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/google_sign_in/google_sign_in/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/google_sign_in/google_sign_in/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/google_sign_in/google_sign_in/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/google_sign_in/google_sign_in/example/lib/main.dart b/packages/google_sign_in/google_sign_in/example/lib/main.dart index 576ec36feffc..a103353c797d 100644 --- a/packages/google_sign_in/google_sign_in/example/lib/main.dart +++ b/packages/google_sign_in/google_sign_in/example/lib/main.dart @@ -15,7 +15,6 @@ import 'package:http/http.dart' as http; import 'src/sign_in_button.dart'; /// The scopes required by this application. -// #docregion Initialize const List scopes = [ 'email', 'https://www.googleapis.com/auth/contacts.readonly', @@ -26,7 +25,6 @@ GoogleSignIn _googleSignIn = GoogleSignIn( // clientId: 'your-client_id.apps.googleusercontent.com', scopes: scopes, ); -// #enddocregion Initialize void main() { runApp( @@ -57,14 +55,12 @@ class _SignInDemoState extends State { _googleSignIn.onCurrentUserChanged .listen((GoogleSignInAccount? account) async { -// #docregion CanAccessScopes // In mobile, being authenticated means being authorized... bool isAuthorized = account != null; - // However, on web... + // However, in the web... if (kIsWeb && account != null) { isAuthorized = await _googleSignIn.canAccessScopes(scopes); } -// #enddocregion CanAccessScopes setState(() { _currentUser = account; @@ -140,7 +136,6 @@ class _SignInDemoState extends State { // // On the web, the on-click handler of the Sign In button is owned by the JS // SDK, so this method can be considered mobile only. - // #docregion SignIn Future _handleSignIn() async { try { await _googleSignIn.signIn(); @@ -148,7 +143,6 @@ class _SignInDemoState extends State { print(error); } } - // #enddocregion SignIn // Prompts the user to authorize `scopes`. // @@ -156,18 +150,14 @@ class _SignInDemoState extends State { // and Authorization at the same time (like the web). // // On the web, this must be called from an user interaction (button click). - // #docregion RequestScopes Future _handleAuthorizeScopes() async { final bool isAuthorized = await _googleSignIn.requestScopes(scopes); - // #enddocregion RequestScopes setState(() { _isAuthorized = isAuthorized; }); - // #docregion RequestScopes if (isAuthorized) { unawaited(_handleGetContact(_currentUser!)); } - // #enddocregion RequestScopes } Future _handleSignOut() => _googleSignIn.disconnect(); diff --git a/packages/google_sign_in/google_sign_in/example/lib/src/sign_in_button/web.dart b/packages/google_sign_in/google_sign_in/example/lib/src/sign_in_button/web.dart index 5c854fc470b5..4189fc6cd724 100644 --- a/packages/google_sign_in/google_sign_in/example/lib/src/sign_in_button/web.dart +++ b/packages/google_sign_in/google_sign_in/example/lib/src/sign_in_button/web.dart @@ -3,11 +3,13 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; -import 'package:google_sign_in_web/web_only.dart' as web; +import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; +import 'package:google_sign_in_web/google_sign_in_web.dart' as web; import 'stub.dart'; /// Renders a web-only SIGN IN button. Widget buildSignInButton({HandleSignInFn? onPressed}) { - return web.renderButton(); + return (GoogleSignInPlatform.instance as web.GoogleSignInPlugin) + .renderButton(); } diff --git a/packages/google_sign_in/google_sign_in/example/macos/.gitignore b/packages/google_sign_in/google_sign_in/example/macos/.gitignore deleted file mode 100644 index 746adbb6b9e1..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Flutter-related -**/Flutter/ephemeral/ -**/Pods/ - -# Xcode-related -**/dgph -**/xcuserdata/ diff --git a/packages/google_sign_in/google_sign_in/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/google_sign_in/google_sign_in/example/macos/Flutter/Flutter-Debug.xcconfig deleted file mode 100644 index 4b81f9b2d200..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Flutter/Flutter-Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/google_sign_in/google_sign_in/example/macos/Flutter/Flutter-Release.xcconfig b/packages/google_sign_in/google_sign_in/example/macos/Flutter/Flutter-Release.xcconfig deleted file mode 100644 index 5caa9d1579e4..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Flutter/Flutter-Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/google_sign_in/google_sign_in/example/macos/Podfile b/packages/google_sign_in/google_sign_in/example/macos/Podfile deleted file mode 100644 index 9ec46f8cd53c..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Podfile +++ /dev/null @@ -1,40 +0,0 @@ -platform :osx, '10.15' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/project.pbxproj b/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index a681b86eb700..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,622 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXAggregateTarget section */ - 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; - buildPhases = ( - 33CC111E2044C6BF0003C045 /* ShellScript */, - ); - dependencies = ( - ); - name = "Flutter Assemble"; - productName = FLX; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - 91EC1EAD56E1573943150DF0 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 16C442C1B9BC9476C95AF0D6 /* Pods_Runner.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC111A2044C6BA0003C045; - remoteInfo = FLX; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 16C442C1B9BC9476C95AF0D6 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; - 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; - 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; - 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 58AF15EFA3113F25F3CCD5CF /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 58C7A396CF655EE2B3D174BF /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 7C68AE67B32D2BA05FA75C07 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - D1E7E66753A51266C0DC3639 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - DC39D4A66D72EB7C33ED15C1 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - F769D9B2CFC1D349BD20C867 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - FC501455AE275E8C66CF7C6A /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 33CC10EA2044A3C60003C045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 91EC1EAD56E1573943150DF0 /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 33BA886A226E78AF003329D5 /* Configs */ = { - isa = PBXGroup; - children = ( - 33E5194F232828860026EE4D /* AppInfo.xcconfig */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, - ); - path = Configs; - sourceTree = ""; - }; - 33CC10E42044A3C60003C045 = { - isa = PBXGroup; - children = ( - 33FAB671232836740065AC1E /* Runner */, - 33CEB47122A05771004F2AC0 /* Flutter */, - 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, - 3AAB212BD66F0D7F5F0118E6 /* Pods */, - ); - sourceTree = ""; - }; - 33CC10EE2044A3C60003C045 /* Products */ = { - isa = PBXGroup; - children = ( - 33CC10ED2044A3C60003C045 /* example.app */, - ); - name = Products; - sourceTree = ""; - }; - 33CC11242044D66E0003C045 /* Resources */ = { - isa = PBXGroup; - children = ( - 33CC10F22044A3C60003C045 /* Assets.xcassets */, - 33CC10F42044A3C60003C045 /* MainMenu.xib */, - 33CC10F72044A3C60003C045 /* Info.plist */, - ); - name = Resources; - path = ..; - sourceTree = ""; - }; - 33CEB47122A05771004F2AC0 /* Flutter */ = { - isa = PBXGroup; - children = ( - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - ); - path = Flutter; - sourceTree = ""; - }; - 33FAB671232836740065AC1E /* Runner */ = { - isa = PBXGroup; - children = ( - 33CC10F02044A3C60003C045 /* AppDelegate.swift */, - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, - 33E51913231747F40026EE4D /* DebugProfile.entitlements */, - 33E51914231749380026EE4D /* Release.entitlements */, - 33CC11242044D66E0003C045 /* Resources */, - 33BA886A226E78AF003329D5 /* Configs */, - ); - path = Runner; - sourceTree = ""; - }; - 3AAB212BD66F0D7F5F0118E6 /* Pods */ = { - isa = PBXGroup; - children = ( - 7C68AE67B32D2BA05FA75C07 /* Pods-Runner.debug.xcconfig */, - FC501455AE275E8C66CF7C6A /* Pods-Runner.release.xcconfig */, - DC39D4A66D72EB7C33ED15C1 /* Pods-Runner.profile.xcconfig */, - 58C7A396CF655EE2B3D174BF /* Pods-RunnerTests.debug.xcconfig */, - F769D9B2CFC1D349BD20C867 /* Pods-RunnerTests.release.xcconfig */, - D1E7E66753A51266C0DC3639 /* Pods-RunnerTests.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - 16C442C1B9BC9476C95AF0D6 /* Pods_Runner.framework */, - 58AF15EFA3113F25F3CCD5CF /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 33CC10EC2044A3C60003C045 /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - DD22313F1BC2623931943E8D /* [CP] Check Pods Manifest.lock */, - 33CC10E92044A3C60003C045 /* Sources */, - 33CC10EA2044A3C60003C045 /* Frameworks */, - 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 33CC11202044C79F0003C045 /* PBXTargetDependency */, - ); - name = Runner; - productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* example.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 33CC10E52044A3C60003C045 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1430; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 33CC10EC2044A3C60003C045 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.Sandbox = { - enabled = 1; - }; - }; - }; - 33CC111A2044C6BA0003C045 = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 33CC10E42044A3C60003C045; - productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 33CC10EC2044A3C60003C045 /* Runner */, - 33CC111A2044C6BA0003C045 /* Flutter Assemble */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 33CC10EB2044A3C60003C045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; - }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, - ); - outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; - }; - DD22313F1BC2623931943E8D /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 33CC10E92044A3C60003C045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; - targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 33CC10F52044A3C60003C045 /* Base */, - ); - name = MainMenu.xib; - path = Runner; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 338D0CE9231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Profile; - }; - 338D0CEA231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Profile; - }; - 338D0CEB231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profile; - }; - 33CC10F92044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 33CC10FA2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - 33CC10FC2044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 33CC10FD2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 33CC111C2044C6BA0003C045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 33CC111D2044C6BA0003C045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10F92044A3C60003C045 /* Debug */, - 33CC10FA2044A3C60003C045 /* Release */, - 338D0CE9231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10FC2044A3C60003C045 /* Debug */, - 33CC10FD2044A3C60003C045 /* Release */, - 338D0CEA231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC111C2044C6BA0003C045 /* Debug */, - 33CC111D2044C6BA0003C045 /* Release */, - 338D0CEB231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 33CC10E52044A3C60003C045 /* Project object */; -} diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 397f3d339fde..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/google_sign_in/google_sign_in/example/macos/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/google_sign_in/google_sign_in/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/AppDelegate.swift b/packages/google_sign_in/google_sign_in/example/macos/Runner/AppDelegate.swift deleted file mode 100644 index 5cec4c48f620..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Cocoa -import FlutterMacOS - -@NSApplicationMain -class AppDelegate: FlutterAppDelegate { - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return true - } -} diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a2ec33f19f11..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" - }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png deleted file mode 100644 index 82b6f9d9a33e..000000000000 Binary files a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png deleted file mode 100644 index 13b35eba55c6..000000000000 Binary files a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png deleted file mode 100644 index 0a3f5fa40fb3..000000000000 Binary files a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png deleted file mode 100644 index bdb57226d5f2..000000000000 Binary files a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png deleted file mode 100644 index f083318e09ca..000000000000 Binary files a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png deleted file mode 100644 index 326c0e72c9d8..000000000000 Binary files a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png deleted file mode 100644 index 2f1632cfddf3..000000000000 Binary files a/packages/google_sign_in/google_sign_in/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/google_sign_in/google_sign_in/example/macos/Runner/Base.lproj/MainMenu.xib deleted file mode 100644 index 80e867a4e06b..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/Base.lproj/MainMenu.xib +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/AppInfo.xcconfig deleted file mode 100644 index e957f60d65b7..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/AppInfo.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// Application-level settings for the Runner target. -// -// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the -// future. If not, the values below would default to using the project name when this becomes a -// 'flutter create' template. - -// The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = example - -// The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.example - -// The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter.plugins. All rights reserved. diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Debug.xcconfig b/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Debug.xcconfig deleted file mode 100644 index 36b0fd9464f4..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Debug.xcconfig" -#include "Warnings.xcconfig" diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Release.xcconfig b/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Release.xcconfig deleted file mode 100644 index dff4f49561c8..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Release.xcconfig" -#include "Warnings.xcconfig" diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Warnings.xcconfig b/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Warnings.xcconfig deleted file mode 100644 index 42bcbf4780b1..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/Configs/Warnings.xcconfig +++ /dev/null @@ -1,13 +0,0 @@ -WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES -CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_PRAGMA_PACK = YES -CLANG_WARN_STRICT_PROTOTYPES = YES -CLANG_WARN_COMMA = YES -GCC_WARN_STRICT_SELECTOR_MATCH = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -GCC_WARN_SHADOW = YES -CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/DebugProfile.entitlements b/packages/google_sign_in/google_sign_in/example/macos/Runner/DebugProfile.entitlements deleted file mode 100644 index dddb8a30c851..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/DebugProfile.entitlements +++ /dev/null @@ -1,12 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Info.plist b/packages/google_sign_in/google_sign_in/example/macos/Runner/Info.plist deleted file mode 100644 index f7026add67e5..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLSchemes - - com.googleusercontent.apps.479882132969-9i9aqik3jfjd7qhci1nqf0bm2g71rm1u - - - - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - GIDClientID - 479882132969-9i9aqik3jfjd7qhci1nqf0bm2g71rm1u.apps.googleusercontent.com - GIDServerClientID - YOUR_SERVER_CLIENT_ID - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/MainFlutterWindow.swift b/packages/google_sign_in/google_sign_in/example/macos/Runner/MainFlutterWindow.swift deleted file mode 100644 index f21908966e95..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/MainFlutterWindow.swift +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Cocoa -import FlutterMacOS - -class MainFlutterWindow: NSWindow { - override func awakeFromNib() { - let flutterViewController = FlutterViewController() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - - RegisterGeneratedPlugins(registry: flutterViewController) - - super.awakeFromNib() - } -} diff --git a/packages/google_sign_in/google_sign_in/example/macos/Runner/Release.entitlements b/packages/google_sign_in/google_sign_in/example/macos/Runner/Release.entitlements deleted file mode 100644 index 852fa1a4728a..000000000000 --- a/packages/google_sign_in/google_sign_in/example/macos/Runner/Release.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.security.app-sandbox - - - diff --git a/packages/google_sign_in/google_sign_in/example/pubspec.yaml b/packages/google_sign_in/google_sign_in/example/pubspec.yaml index 19a6bf6e9462..c2558f5f6c9e 100644 --- a/packages/google_sign_in/google_sign_in/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Example of Google Sign-In plugin. publish_to: none environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" dependencies: flutter: @@ -16,7 +16,8 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - google_sign_in_web: ^0.12.3 + google_sign_in_platform_interface: ^2.4.0 + google_sign_in_web: ^0.12.0 http: ">=0.13.0 <2.0.0" dev_dependencies: diff --git a/packages/google_sign_in/google_sign_in/example/web/index.html b/packages/google_sign_in/google_sign_in/example/web/index.html index eff8f4effadb..6bd23335f2c1 100644 --- a/packages/google_sign_in/google_sign_in/example/web/index.html +++ b/packages/google_sign_in/google_sign_in/example/web/index.html @@ -7,17 +7,8 @@ Google Sign-in Example - - + diff --git a/packages/google_sign_in/google_sign_in/pubspec.yaml b/packages/google_sign_in/google_sign_in/pubspec.yaml index 08fd7e39fe98..a86b08c2ff37 100644 --- a/packages/google_sign_in/google_sign_in/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in/pubspec.yaml @@ -1,13 +1,13 @@ name: google_sign_in description: Flutter plugin for Google Sign-In, a secure authentication system - for signing in with a Google account. + for signing in with a Google account on Android and iOS. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 6.2.1 +version: 6.1.6 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" flutter: plugin: @@ -16,8 +16,6 @@ flutter: default_package: google_sign_in_android ios: default_package: google_sign_in_ios - macos: - default_package: google_sign_in_ios web: default_package: google_sign_in_web @@ -25,7 +23,7 @@ dependencies: flutter: sdk: flutter google_sign_in_android: ^6.1.0 - google_sign_in_ios: ^5.7.0 + google_sign_in_ios: ^5.5.0 google_sign_in_platform_interface: ^2.4.0 google_sign_in_web: ^0.12.0 @@ -36,7 +34,7 @@ dev_dependencies: http: ">=0.13.0 <2.0.0" integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - authentication @@ -48,4 +46,3 @@ false_secrets: - /example/ios/Runner/Info.plist - /example/ios/RunnerTests/GoogleService-Info.plist - /example/ios/RunnerTests/GoogleSignInTests.m - - /example/macos/Runner/Info.plist diff --git a/packages/google_sign_in/google_sign_in/test/google_sign_in_test.mocks.dart b/packages/google_sign_in/google_sign_in/test/google_sign_in_test.mocks.dart index c1ddb742a72c..831e6bdb4398 100644 --- a/packages/google_sign_in/google_sign_in/test/google_sign_in_test.mocks.dart +++ b/packages/google_sign_in/google_sign_in/test/google_sign_in_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in google_sign_in/test/google_sign_in_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; @@ -14,8 +16,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -48,7 +48,6 @@ class MockGoogleSignInPlatform extends _i1.Mock Invocation.getter(#isMock), returnValue: false, ) as bool); - @override _i4.Future init({ List? scopes = const [], @@ -70,7 +69,6 @@ class MockGoogleSignInPlatform extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future initWithParams(_i2.SignInInitParameters? params) => (super.noSuchMethod( @@ -81,7 +79,6 @@ class MockGoogleSignInPlatform extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future<_i2.GoogleSignInUserData?> signInSilently() => (super.noSuchMethod( Invocation.method( @@ -90,7 +87,6 @@ class MockGoogleSignInPlatform extends _i1.Mock ), returnValue: _i4.Future<_i2.GoogleSignInUserData?>.value(), ) as _i4.Future<_i2.GoogleSignInUserData?>); - @override _i4.Future<_i2.GoogleSignInUserData?> signIn() => (super.noSuchMethod( Invocation.method( @@ -99,7 +95,6 @@ class MockGoogleSignInPlatform extends _i1.Mock ), returnValue: _i4.Future<_i2.GoogleSignInUserData?>.value(), ) as _i4.Future<_i2.GoogleSignInUserData?>); - @override _i4.Future<_i2.GoogleSignInTokenData> getTokens({ required String? email, @@ -127,7 +122,6 @@ class MockGoogleSignInPlatform extends _i1.Mock ), )), ) as _i4.Future<_i2.GoogleSignInTokenData>); - @override _i4.Future signOut() => (super.noSuchMethod( Invocation.method( @@ -137,7 +131,6 @@ class MockGoogleSignInPlatform extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future disconnect() => (super.noSuchMethod( Invocation.method( @@ -147,7 +140,6 @@ class MockGoogleSignInPlatform extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future isSignedIn() => (super.noSuchMethod( Invocation.method( @@ -156,7 +148,6 @@ class MockGoogleSignInPlatform extends _i1.Mock ), returnValue: _i4.Future.value(false), ) as _i4.Future); - @override _i4.Future clearAuthCache({required String? token}) => (super.noSuchMethod( @@ -168,7 +159,6 @@ class MockGoogleSignInPlatform extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future requestScopes(List? scopes) => (super.noSuchMethod( Invocation.method( @@ -177,7 +167,6 @@ class MockGoogleSignInPlatform extends _i1.Mock ), returnValue: _i4.Future.value(false), ) as _i4.Future); - @override _i4.Future canAccessScopes( List? scopes, { diff --git a/packages/google_sign_in/google_sign_in_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/google_sign_in/google_sign_in_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/google_sign_in/google_sign_in_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/google_sign_in/google_sign_in_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/google_sign_in/google_sign_in_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/google_sign_in/google_sign_in_android/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/google_sign_in/google_sign_in_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/google_sign_in/google_sign_in_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/google_sign_in/google_sign_in_android/pubspec.yaml b/packages/google_sign_in/google_sign_in_android/pubspec.yaml index d121366de0af..3d4d946bca7b 100644 --- a/packages/google_sign_in/google_sign_in_android/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_android/pubspec.yaml @@ -28,7 +28,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^10.1.0 topics: diff --git a/packages/google_sign_in/google_sign_in_android/test/google_sign_in_android_test.mocks.dart b/packages/google_sign_in/google_sign_in_android/test/google_sign_in_android_test.mocks.dart index 85f19ba213b7..b6a5fed37137 100644 --- a/packages/google_sign_in/google_sign_in_android/test/google_sign_in_android_test.mocks.dart +++ b/packages/google_sign_in/google_sign_in_android/test/google_sign_in_android_test.mocks.dart @@ -1,20 +1,19 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in google_sign_in_android/test/google_sign_in_android_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; import 'package:google_sign_in_android/src/messages.g.dart' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -49,7 +48,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future<_i2.UserData> signInSilently() => (super.noSuchMethod( Invocation.method( @@ -64,7 +62,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { ), )), ) as _i3.Future<_i2.UserData>); - @override _i3.Future<_i2.UserData> signIn() => (super.noSuchMethod( Invocation.method( @@ -79,7 +76,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { ), )), ) as _i3.Future<_i2.UserData>); - @override _i3.Future getAccessToken( String? arg_email, @@ -93,18 +89,8 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { arg_shouldRecoverAuth, ], ), - returnValue: _i3.Future.value(_i4.dummyValue( - this, - Invocation.method( - #getAccessToken, - [ - arg_email, - arg_shouldRecoverAuth, - ], - ), - )), + returnValue: _i3.Future.value(''), ) as _i3.Future); - @override _i3.Future signOut() => (super.noSuchMethod( Invocation.method( @@ -114,7 +100,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future disconnect() => (super.noSuchMethod( Invocation.method( @@ -124,7 +109,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future isSignedIn() => (super.noSuchMethod( Invocation.method( @@ -133,7 +117,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i3.Future clearAuthCache(String? arg_token) => (super.noSuchMethod( Invocation.method( @@ -143,7 +126,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future requestScopes(List? arg_scopes) => (super.noSuchMethod( diff --git a/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md b/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md index 6724341e98da..f48258887480 100644 --- a/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_ios/CHANGELOG.md @@ -1,11 +1,6 @@ -## 5.7.1 +## NEXT -* Changes `pigeon` to a dev dependency. - -## 5.7.0 - -* Adds support for macOS. -* Updates minimum supported SDK version to Flutter 3.16/Dart 3.2. +* Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 5.6.5 diff --git a/packages/google_sign_in/google_sign_in_ios/README.md b/packages/google_sign_in/google_sign_in_ios/README.md index 20cf221aeb56..29bcc25fb18f 100644 --- a/packages/google_sign_in/google_sign_in_ios/README.md +++ b/packages/google_sign_in/google_sign_in_ios/README.md @@ -1,6 +1,6 @@ # google\_sign\_in\_ios -The iOS and macOS implementation of [`google_sign_in`][1]. +The iOS implementation of [`google_sign_in`][1]. ## Usage @@ -11,21 +11,6 @@ so you do not need to add it to your `pubspec.yaml`. However, if you `import` this package to use any of its APIs directly, you should add it to your `pubspec.yaml` as usual. -### macOS setup - -The GoogleSignIn SDK requires keychain sharing to be enabled, by [adding the -following entitlements](https://docs.flutter.dev/platform-integration/macos/building#entitlements-and-the-app-sandbox): - -```xml - keychain-access-groups - - $(AppIdentifierPrefix)com.google.GIDSignIn - -``` - -Without this step, the plugin will throw a `keychain error` `PlatformException` -when trying to sign in. - [1]: https://pub.dev/packages/google_sign_in [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin diff --git a/packages/google_sign_in/google_sign_in_ios/example/ios/Runner.xcodeproj/project.pbxproj b/packages/google_sign_in/google_sign_in_ios/example/ios/Runner.xcodeproj/project.pbxproj index e147a2e349b7..ca1508eba8ca 100644 --- a/packages/google_sign_in/google_sign_in_ios/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/google_sign_in/google_sign_in_ios/example/ios/Runner.xcodeproj/project.pbxproj @@ -59,7 +59,7 @@ 5A76713E622F06379AEDEBFA /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 5C6F5A6C1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 5C6F5A6D1EC3B4CB008D64B5 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../darwin/Tests/GoogleService-Info.plist"; sourceTree = SOURCE_ROOT; }; + 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 7ACDFB0D1E8944C400BE2D00 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; @@ -74,7 +74,7 @@ 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F582639B44581540871D9BB0 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; F76AC1A22666D0540040C8BC /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - F76AC1A42666D0540040C8BC /* GoogleSignInTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GoogleSignInTests.m; path = ../../darwin/Tests/GoogleSignInTests.m; sourceTree = SOURCE_ROOT; }; + F76AC1A42666D0540040C8BC /* GoogleSignInTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoogleSignInTests.m; sourceTree = ""; }; F76AC1A62666D0540040C8BC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; F76AC1B02666D0610040C8BC /* RunnerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; F76AC1B22666D0610040C8BC /* GoogleSignInUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GoogleSignInUITests.m; sourceTree = ""; }; @@ -189,8 +189,8 @@ F76AC1A32666D0540040C8BC /* RunnerTests */ = { isa = PBXGroup; children = ( - 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */, F76AC1A42666D0540040C8BC /* GoogleSignInTests.m */, + 7A303C2D1E89D76400B1F19E /* GoogleService-Info.plist */, F76AC1A62666D0540040C8BC /* Info.plist */, ); path = RunnerTests; @@ -611,10 +611,7 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -635,10 +632,7 @@ "$(PROJECT_DIR)/Flutter", ); INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", @@ -655,11 +649,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = RunnerTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner"; @@ -673,11 +663,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = RunnerTests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerTests; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/Runner"; @@ -689,11 +675,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = RunnerUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_TARGET_NAME = Runner; @@ -705,11 +687,7 @@ buildSettings = { CODE_SIGN_STYLE = Automatic; INFOPLIST_FILE = RunnerUITests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests; PRODUCT_NAME = "$(TARGET_NAME)"; TEST_TARGET_NAME = Runner; diff --git a/packages/google_sign_in/google_sign_in_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/google_sign_in/google_sign_in_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json index 8122b0a0c2f2..d22f10b2ab63 100644 --- a/packages/google_sign_in/google_sign_in_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/packages/google_sign_in/google_sign_in_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,121 +1,116 @@ { "images" : [ { - "filename" : "Icon-App-20x20@2x.png", + "size" : "20x20", "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" }, { - "filename" : "Icon-App-20x20@3x.png", + "size" : "20x20", "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" + "filename" : "Icon-App-20x20@3x.png", + "scale" : "3x" }, { - "filename" : "Icon-App-29x29@1x.png", + "size" : "29x29", "idiom" : "iphone", - "scale" : "1x", - "size" : "29x29" + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" }, { - "filename" : "Icon-App-29x29@2x.png", + "size" : "29x29", "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" }, { - "filename" : "Icon-App-29x29@3x.png", + "size" : "29x29", "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" + "filename" : "Icon-App-29x29@3x.png", + "scale" : "3x" }, { - "filename" : "Icon-App-40x40@2x.png", + "size" : "40x40", "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" }, { - "filename" : "Icon-App-40x40@3x.png", + "size" : "40x40", "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" + "filename" : "Icon-App-40x40@3x.png", + "scale" : "3x" }, { - "filename" : "Icon-App-60x60@2x.png", + "size" : "60x60", "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" + "filename" : "Icon-App-60x60@2x.png", + "scale" : "2x" }, { - "filename" : "Icon-App-60x60@3x.png", + "size" : "60x60", "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" + "filename" : "Icon-App-60x60@3x.png", + "scale" : "3x" }, { - "filename" : "Icon-App-20x20@1x.png", + "size" : "20x20", "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" + "filename" : "Icon-App-20x20@1x.png", + "scale" : "1x" }, { - "filename" : "Icon-App-20x20@2x.png", + "size" : "20x20", "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" + "filename" : "Icon-App-20x20@2x.png", + "scale" : "2x" }, { - "filename" : "Icon-App-29x29@1x.png", + "size" : "29x29", "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" + "filename" : "Icon-App-29x29@1x.png", + "scale" : "1x" }, { - "filename" : "Icon-App-29x29@2x.png", + "size" : "29x29", "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" + "filename" : "Icon-App-29x29@2x.png", + "scale" : "2x" }, { - "filename" : "Icon-App-40x40@1x.png", + "size" : "40x40", "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" + "filename" : "Icon-App-40x40@1x.png", + "scale" : "1x" }, { - "filename" : "Icon-App-40x40@2x.png", + "size" : "40x40", "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" + "filename" : "Icon-App-40x40@2x.png", + "scale" : "2x" }, { - "filename" : "Icon-App-76x76@1x.png", + "size" : "76x76", "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" + "filename" : "Icon-App-76x76@1x.png", + "scale" : "1x" }, { - "filename" : "Icon-App-76x76@2x.png", + "size" : "76x76", "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" + "filename" : "Icon-App-76x76@2x.png", + "scale" : "2x" }, { - "filename" : "Icon-App-83.5x83.5@2x.png", + "size" : "83.5x83.5", "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", - "size" : "1024x1024" + "filename" : "Icon-App-83.5x83.5@2x.png", + "scale" : "2x" } ], "info" : { - "author" : "xcode", - "version" : 1 + "version" : 1, + "author" : "xcode" } } diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Tests/GoogleService-Info.plist b/packages/google_sign_in/google_sign_in_ios/example/ios/RunnerTests/GoogleService-Info.plist similarity index 100% rename from packages/google_sign_in/google_sign_in_ios/darwin/Tests/GoogleService-Info.plist rename to packages/google_sign_in/google_sign_in_ios/example/ios/RunnerTests/GoogleService-Info.plist diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Tests/GoogleSignInTests.m b/packages/google_sign_in/google_sign_in_ios/example/ios/RunnerTests/GoogleSignInTests.m similarity index 70% rename from packages/google_sign_in/google_sign_in_ios/darwin/Tests/GoogleSignInTests.m rename to packages/google_sign_in/google_sign_in_ios/example/ios/RunnerTests/GoogleSignInTests.m index 1d49c9865f1c..de504636e65d 100644 --- a/packages/google_sign_in/google_sign_in_ios/darwin/Tests/GoogleSignInTests.m +++ b/packages/google_sign_in/google_sign_in_ios/example/ios/RunnerTests/GoogleSignInTests.m @@ -2,12 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include -#if TARGET_OS_OSX -@import FlutterMacOS; -#else @import Flutter; -#endif @import XCTest; @import google_sign_in_ios; @@ -38,8 +33,7 @@ - (void)setUp { self.mockSignIn = mockSignIn; OCMStub(self.mockPluginRegistrar.messenger).andReturn(self.mockBinaryMessenger); - self.plugin = [[FLTGoogleSignInPlugin alloc] initWithSignIn:mockSignIn - registrar:self.mockPluginRegistrar]; + self.plugin = [[FLTGoogleSignInPlugin alloc] initWithSignIn:mockSignIn]; [FLTGoogleSignInPlugin registerWithRegistrar:self.mockPluginRegistrar]; NSString *plistPath = @@ -58,8 +52,7 @@ - (void)testSignOut { } - (void)testDisconnect { - [(GIDSignIn *)[self.mockSignIn stub] - disconnectWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], nil]]; + [[self.mockSignIn stub] disconnectWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"]; [self.plugin disconnectWithCompletion:^(FlutterError *error) { @@ -70,11 +63,10 @@ - (void)testDisconnect { } - (void)testDisconnectIgnoresError { - NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain - code:kGIDSignInErrorCodeHasNoAuthInKeychain - userInfo:nil]; - [(GIDSignIn *)[self.mockSignIn stub] - disconnectWithCompletion:[OCMArg invokeBlockWithArgs:sdkError, nil]]; + NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain + code:kGIDSignInErrorCodeHasNoAuthInKeychain + userInfo:nil]; + [[self.mockSignIn stub] disconnectWithCompletion:[OCMArg invokeBlockWithArgs:error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"expect result returns true"]; [self.plugin disconnectWithCompletion:^(FlutterError *error) { @@ -89,8 +81,7 @@ - (void)testDisconnectIgnoresError { - (void)testInitNoClientIdNoError { // Init plugin without GoogleService-Info.plist. self.plugin = [[FLTGoogleSignInPlugin alloc] initWithSignIn:self.mockSignIn - registrar:self.mockPluginRegistrar - googleServiceProperties:nil]; + withGoogleServiceProperties:nil]; // init call does not provide a clientId. FSIInitParams *params = [FSIInitParams makeWithScopes:@[] @@ -105,24 +96,24 @@ - (void)testInitNoClientIdNoError { - (void)testInitGoogleServiceInfoPlist { self.plugin = [[FLTGoogleSignInPlugin alloc] initWithSignIn:self.mockSignIn - registrar:self.mockPluginRegistrar - googleServiceProperties:self.googleServiceInfo]; + withGoogleServiceProperties:self.googleServiceInfo]; FSIInitParams *params = [FSIInitParams makeWithScopes:@[] hostedDomain:@"example.com" clientId:nil serverClientId:nil]; - FlutterError *initializationError; - [self.plugin initializeSignInWithParameters:params error:&initializationError]; - XCTAssertNil(initializationError); + FlutterError *error; + [self.plugin initializeSignInWithParameters:params error:&error]; + XCTAssertNil(error); // Initialization values used in the next sign in request. [self.plugin signInWithCompletion:^(FSIUserData *user, FlutterError *error){ }]; - OCMVerify([self configureMock:self.mockSignIn - forSignInWithHint:nil - additionalScopes:OCMOCK_ANY - completion:OCMOCK_ANY]); + OCMVerify([self.mockSignIn + signInWithPresentingViewController:[OCMArg isKindOfClass:[FlutterViewController class]] + hint:nil + additionalScopes:OCMOCK_ANY + completion:OCMOCK_ANY]); XCTAssertEqualObjects(self.plugin.configuration.hostedDomain, @"example.com"); // Set in example app GoogleService-Info.plist. @@ -135,25 +126,25 @@ - (void)testInitGoogleServiceInfoPlist { - (void)testInitDynamicClientIdNullDomain { // Init plugin without GoogleService-Info.plist. self.plugin = [[FLTGoogleSignInPlugin alloc] initWithSignIn:self.mockSignIn - registrar:self.mockPluginRegistrar - googleServiceProperties:nil]; + withGoogleServiceProperties:nil]; FSIInitParams *params = [FSIInitParams makeWithScopes:@[] hostedDomain:nil clientId:@"mockClientId" serverClientId:nil]; - FlutterError *initializationError; - [self.plugin initializeSignInWithParameters:params error:&initializationError]; - XCTAssertNil(initializationError); + FlutterError *error; + [self.plugin initializeSignInWithParameters:params error:&error]; + XCTAssertNil(error); // Initialization values used in the next sign in request. [self.plugin signInWithCompletion:^(FSIUserData *user, FlutterError *error){ }]; - OCMVerify([self configureMock:self.mockSignIn - forSignInWithHint:nil - additionalScopes:OCMOCK_ANY - completion:OCMOCK_ANY]); + OCMVerify([self.mockSignIn + signInWithPresentingViewController:[OCMArg isKindOfClass:[FlutterViewController class]] + hint:nil + additionalScopes:OCMOCK_ANY + completion:OCMOCK_ANY]); XCTAssertEqualObjects(self.plugin.configuration.hostedDomain, nil); XCTAssertEqualObjects(self.plugin.configuration.clientID, @"mockClientId"); @@ -162,23 +153,23 @@ - (void)testInitDynamicClientIdNullDomain { - (void)testInitDynamicServerClientIdNullDomain { self.plugin = [[FLTGoogleSignInPlugin alloc] initWithSignIn:self.mockSignIn - registrar:self.mockPluginRegistrar - googleServiceProperties:self.googleServiceInfo]; + withGoogleServiceProperties:self.googleServiceInfo]; FSIInitParams *params = [FSIInitParams makeWithScopes:@[] hostedDomain:nil clientId:nil serverClientId:@"mockServerClientId"]; - FlutterError *initializationError; - [self.plugin initializeSignInWithParameters:params error:&initializationError]; - XCTAssertNil(initializationError); + FlutterError *error; + [self.plugin initializeSignInWithParameters:params error:&error]; + XCTAssertNil(error); // Initialization values used in the next sign in request. [self.plugin signInWithCompletion:^(FSIUserData *user, FlutterError *error){ }]; - OCMVerify([self configureMock:self.mockSignIn - forSignInWithHint:nil - additionalScopes:OCMOCK_ANY - completion:OCMOCK_ANY]); + OCMVerify([self.mockSignIn + signInWithPresentingViewController:[OCMArg isKindOfClass:[FlutterViewController class]] + hint:nil + additionalScopes:OCMOCK_ANY + completion:OCMOCK_ANY]); XCTAssertEqualObjects(self.plugin.configuration.hostedDomain, nil); // Set in example app GoogleService-Info.plist. @@ -195,7 +186,7 @@ - (void)testInitInfoPlist { serverClientId:nil]; FlutterError *error; - self.plugin = [[FLTGoogleSignInPlugin alloc] initWithRegistrar:self.mockPluginRegistrar]; + self.plugin = [[FLTGoogleSignInPlugin alloc] init]; [self.plugin initializeSignInWithParameters:params error:&error]; XCTAssertNil(error); XCTAssertNil(self.plugin.configuration); @@ -252,13 +243,12 @@ - (void)testSignInSilently { } - (void)testSignInSilentlyWithError { - NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain - code:kGIDSignInErrorCodeHasNoAuthInKeychain - userInfo:nil]; + NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain + code:kGIDSignInErrorCodeHasNoAuthInKeychain + userInfo:nil]; [[self.mockSignIn stub] - restorePreviousSignInWithCompletion:[OCMArg - invokeBlockWithArgs:[NSNull null], sdkError, nil]]; + restorePreviousSignInWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin signInSilentlyWithCompletion:^(FSIUserData *user, FlutterError *error) { @@ -273,8 +263,7 @@ - (void)testSignInSilentlyWithError { - (void)testSignIn { self.plugin = [[FLTGoogleSignInPlugin alloc] initWithSignIn:self.mockSignIn - registrar:self.mockPluginRegistrar - googleServiceProperties:self.googleServiceInfo]; + withGoogleServiceProperties:self.googleServiceInfo]; id mockUser = OCMClassMock([GIDGoogleUser class]); id mockUserProfile = OCMClassMock([GIDProfileData class]); OCMStub([mockUserProfile name]).andReturn(@"mockDisplay"); @@ -290,10 +279,12 @@ - (void)testSignIn { OCMStub([mockSignInResult user]).andReturn(mockUser); OCMStub([mockSignInResult serverAuthCode]).andReturn(@"mockAuthCode"); - [self configureMock:[self.mockSignIn expect] - forSignInWithHint:nil - additionalScopes:@[] - completion:[OCMArg invokeBlockWithArgs:mockSignInResult, [NSNull null], nil]]; + [[self.mockSignIn expect] + signInWithPresentingViewController:[OCMArg isKindOfClass:[FlutterViewController class]] + hint:nil + additionalScopes:@[] + completion:[OCMArg invokeBlockWithArgs:mockSignInResult, + [NSNull null], nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin signInWithCompletion:^(FSIUserData *user, FlutterError *error) { @@ -316,26 +307,28 @@ - (void)testSignIn { } - (void)testSignInWithInitializedScopes { - FlutterError *initializationError; + FlutterError *error; [self.plugin initializeSignInWithParameters:[FSIInitParams makeWithScopes:@[ @"initial1", @"initial2" ] hostedDomain:nil clientId:nil serverClientId:nil] - error:&initializationError]; + error:&error]; id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([mockUser userID]).andReturn(@"mockID"); id mockSignInResult = OCMClassMock([GIDSignInResult class]); OCMStub([mockSignInResult user]).andReturn(mockUser); - [self configureMock:[self.mockSignIn expect] - forSignInWithHint:nil - additionalScopes:[OCMArg checkWithBlock:^BOOL(NSArray *scopes) { - return [[NSSet setWithArray:scopes] - isEqualToSet:[NSSet setWithObjects:@"initial1", @"initial2", nil]]; - }] - completion:[OCMArg invokeBlockWithArgs:mockSignInResult, [NSNull null], nil]]; + [[self.mockSignIn expect] + signInWithPresentingViewController:OCMOCK_ANY + hint:nil + additionalScopes:[OCMArg checkWithBlock:^BOOL(NSArray *scopes) { + return [[NSSet setWithArray:scopes] + isEqualToSet:[NSSet setWithObjects:@"initial1", @"initial2", nil]]; + }] + completion:[OCMArg invokeBlockWithArgs:mockSignInResult, + [NSNull null], nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin signInWithCompletion:^(FSIUserData *user, FlutterError *error) { @@ -354,17 +347,19 @@ - (void)testSignInAlreadyGranted { id mockSignInResult = OCMClassMock([GIDSignInResult class]); OCMStub([mockSignInResult user]).andReturn(mockUser); - [self configureMock:[self.mockSignIn stub] - forSignInWithHint:nil - additionalScopes:OCMOCK_ANY - completion:[OCMArg invokeBlockWithArgs:mockSignInResult, [NSNull null], nil]]; - - NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain - code:kGIDSignInErrorCodeScopesAlreadyGranted - userInfo:nil]; - [self configureMock:mockUser - forAddScopes:OCMOCK_ANY - completion:[OCMArg invokeBlockWithArgs:[NSNull null], sdkError, nil]]; + [[self.mockSignIn stub] + signInWithPresentingViewController:OCMOCK_ANY + hint:nil + additionalScopes:OCMOCK_ANY + completion:[OCMArg invokeBlockWithArgs:mockSignInResult, + [NSNull null], nil]]; + + NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain + code:kGIDSignInErrorCodeScopesAlreadyGranted + userInfo:nil]; + [[self.mockSignIn currentUser] addScopes:OCMOCK_ANY + presentingViewController:OCMOCK_ANY + completion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin signInWithCompletion:^(FSIUserData *user, FlutterError *error) { @@ -376,13 +371,14 @@ - (void)testSignInAlreadyGranted { } - (void)testSignInError { - NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain - code:kGIDSignInErrorCodeCanceled - userInfo:nil]; - [self configureMock:[self.mockSignIn stub] - forSignInWithHint:nil - additionalScopes:OCMOCK_ANY - completion:[OCMArg invokeBlockWithArgs:[NSNull null], sdkError, nil]]; + NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain + code:kGIDSignInErrorCodeCanceled + userInfo:nil]; + [[self.mockSignIn stub] + signInWithPresentingViewController:OCMOCK_ANY + hint:nil + additionalScopes:OCMOCK_ANY + completion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin signInWithCompletion:^(FSIUserData *user, FlutterError *error) { @@ -394,10 +390,10 @@ - (void)testSignInError { } - (void)testSignInException { - OCMExpect([self configureMock:self.mockSignIn - forSignInWithHint:OCMOCK_ANY - additionalScopes:OCMOCK_ANY - completion:OCMOCK_ANY]) + OCMExpect([self.mockSignIn signInWithPresentingViewController:OCMOCK_ANY + hint:OCMOCK_ANY + additionalScopes:OCMOCK_ANY + completion:OCMOCK_ANY]) .andThrow([NSException exceptionWithName:@"MockName" reason:@"MockReason" userInfo:nil]); __block FlutterError *error; @@ -445,11 +441,11 @@ - (void)testGetTokensNoAuthKeychainError { id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([self.mockSignIn currentUser]).andReturn(mockUser); - NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain - code:kGIDSignInErrorCodeHasNoAuthInKeychain - userInfo:nil]; - [[mockUser stub] refreshTokensIfNeededWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], - sdkError, nil]]; + NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain + code:kGIDSignInErrorCodeHasNoAuthInKeychain + userInfo:nil]; + [[mockUser stub] + refreshTokensIfNeededWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin getAccessTokenWithCompletion:^(FSITokenData *token, FlutterError *error) { @@ -465,11 +461,11 @@ - (void)testGetTokensCancelledError { id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([self.mockSignIn currentUser]).andReturn(mockUser); - NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain - code:kGIDSignInErrorCodeCanceled - userInfo:nil]; - [[mockUser stub] refreshTokensIfNeededWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], - sdkError, nil]]; + NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain + code:kGIDSignInErrorCodeCanceled + userInfo:nil]; + [[mockUser stub] + refreshTokensIfNeededWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin getAccessTokenWithCompletion:^(FSITokenData *token, FlutterError *error) { @@ -485,11 +481,9 @@ - (void)testGetTokensURLError { id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([self.mockSignIn currentUser]).andReturn(mockUser); - NSError *sdkError = [NSError errorWithDomain:NSURLErrorDomain - code:NSURLErrorTimedOut - userInfo:nil]; - [[mockUser stub] refreshTokensIfNeededWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], - sdkError, nil]]; + NSError *error = [NSError errorWithDomain:NSURLErrorDomain code:NSURLErrorTimedOut userInfo:nil]; + [[mockUser stub] + refreshTokensIfNeededWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin getAccessTokenWithCompletion:^(FSITokenData *token, FlutterError *error) { @@ -505,9 +499,9 @@ - (void)testGetTokensUnknownError { id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([self.mockSignIn currentUser]).andReturn(mockUser); - NSError *sdkError = [NSError errorWithDomain:@"BogusDomain" code:42 userInfo:nil]; - [[mockUser stub] refreshTokensIfNeededWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], - sdkError, nil]]; + NSError *error = [NSError errorWithDomain:@"BogusDomain" code:42 userInfo:nil]; + [[mockUser stub] + refreshTokensIfNeededWithCompletion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin getAccessTokenWithCompletion:^(FSITokenData *token, FlutterError *error) { @@ -536,12 +530,12 @@ - (void)testRequestScopesIfNoMissingScope { id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([self.mockSignIn currentUser]).andReturn(mockUser); - NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain - code:kGIDSignInErrorCodeScopesAlreadyGranted - userInfo:nil]; - [self configureMock:[mockUser stub] - forAddScopes:@[ @"mockScope1" ] - completion:[OCMArg invokeBlockWithArgs:[NSNull null], sdkError, nil]]; + NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain + code:kGIDSignInErrorCodeScopesAlreadyGranted + userInfo:nil]; + [[mockUser stub] addScopes:@[ @"mockScope1" ] + presentingViewController:OCMOCK_ANY + completion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin requestScopes:@[ @"mockScope1" ] @@ -557,12 +551,12 @@ - (void)testRequestScopesResultErrorIfMismatchingUser { id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([self.mockSignIn currentUser]).andReturn(mockUser); - NSError *sdkError = [NSError errorWithDomain:kGIDSignInErrorDomain - code:kGIDSignInErrorCodeMismatchWithCurrentUser - userInfo:nil]; - [self configureMock:[mockUser stub] - forAddScopes:@[ @"mockScope1" ] - completion:[OCMArg invokeBlockWithArgs:[NSNull null], sdkError, nil]]; + NSError *error = [NSError errorWithDomain:kGIDSignInErrorDomain + code:kGIDSignInErrorCodeMismatchWithCurrentUser + userInfo:nil]; + [[mockUser stub] addScopes:@[ @"mockScope1" ] + presentingViewController:OCMOCK_ANY + completion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin requestScopes:@[ @"mockScope1" ] @@ -578,10 +572,10 @@ - (void)testRequestScopesWithUnknownError { id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([self.mockSignIn currentUser]).andReturn(mockUser); - NSError *sdkError = [NSError errorWithDomain:@"BogusDomain" code:42 userInfo:nil]; - [self configureMock:[mockUser stub] - forAddScopes:@[ @"mockScope1" ] - completion:[OCMArg invokeBlockWithArgs:[NSNull null], sdkError, nil]]; + NSError *error = [NSError errorWithDomain:@"BogusDomain" code:42 userInfo:nil]; + [[mockUser stub] addScopes:@[ @"mockScope1" ] + presentingViewController:OCMOCK_ANY + completion:[OCMArg invokeBlockWithArgs:[NSNull null], error, nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin requestScopes:@[ @"mockScope1" ] @@ -597,7 +591,7 @@ - (void)testRequestScopesException { id mockUser = OCMClassMock([GIDGoogleUser class]); OCMStub([self.mockSignIn currentUser]).andReturn(mockUser); - OCMExpect([self configureMock:mockUser forAddScopes:@[] completion:OCMOCK_ANY]) + OCMExpect([mockUser addScopes:@[] presentingViewController:OCMOCK_ANY completion:OCMOCK_ANY]) .andThrow([NSException exceptionWithName:@"MockName" reason:@"MockReason" userInfo:nil]); [self.plugin requestScopes:@[] @@ -619,9 +613,9 @@ - (void)testRequestScopesReturnsFalseIfOnlySubsetGranted { OCMStub([mockUser grantedScopes]).andReturn(@[ @"mockScope1" ]); OCMStub([mockSignInResult user]).andReturn(mockUser); - [self configureMock:[mockUser stub] - forAddScopes:requestedScopes - completion:[OCMArg invokeBlockWithArgs:mockSignInResult, [NSNull null], nil]]; + [[mockUser stub] addScopes:requestedScopes + presentingViewController:OCMOCK_ANY + completion:[OCMArg invokeBlockWithArgs:mockSignInResult, [NSNull null], nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin requestScopes:requestedScopes @@ -641,9 +635,9 @@ - (void)testRequestsInitializedScopes { hostedDomain:nil clientId:nil serverClientId:nil]; - FlutterError *initializationError; - [self.plugin initializeSignInWithParameters:params error:&initializationError]; - XCTAssertNil(initializationError); + FlutterError *error; + [self.plugin initializeSignInWithParameters:params error:&error]; + XCTAssertNil(error); // Include one of the initially requested scopes. NSArray *addedScopes = @[ @"initial1", @"addScope1", @"addScope2" ]; @@ -653,13 +647,13 @@ - (void)testRequestsInitializedScopes { }]; // All four scopes are requested. - [self configureMock:[mockUser verify] - forAddScopes:[OCMArg checkWithBlock:^BOOL(NSArray *scopes) { - return [[NSSet setWithArray:scopes] - isEqualToSet:[NSSet setWithObjects:@"initial1", @"initial2", @"addScope1", - @"addScope2", nil]]; - }] - completion:OCMOCK_ANY]; + [[mockUser verify] addScopes:[OCMArg checkWithBlock:^BOOL(NSArray *scopes) { + return [[NSSet setWithArray:scopes] + isEqualToSet:[NSSet setWithObjects:@"initial1", @"initial2", + @"addScope1", @"addScope2", nil]]; + }] + presentingViewController:OCMOCK_ANY + completion:OCMOCK_ANY]; } - (void)testRequestScopesReturnsTrueIfGranted { @@ -672,9 +666,9 @@ - (void)testRequestScopesReturnsTrueIfGranted { OCMStub([mockUser grantedScopes]).andReturn(requestedScopes); OCMStub([mockSignInResult user]).andReturn(mockUser); - [self configureMock:[mockUser stub] - forAddScopes:requestedScopes - completion:[OCMArg invokeBlockWithArgs:mockSignInResult, [NSNull null], nil]]; + [[mockUser stub] addScopes:requestedScopes + presentingViewController:OCMOCK_ANY + completion:[OCMArg invokeBlockWithArgs:mockSignInResult, [NSNull null], nil]]; XCTestExpectation *expectation = [self expectationWithDescription:@"completion called"]; [self.plugin requestScopes:requestedScopes @@ -686,34 +680,4 @@ - (void)testRequestScopesReturnsTrueIfGranted { [self waitForExpectationsWithTimeout:5.0 handler:nil]; } -#pragma mark - Utils - -- (void)configureMock:(id)mock - forAddScopes:(NSArray *)scopes - completion:(nullable void (^)(GIDSignInResult *_Nullable signInResult, - NSError *_Nullable error))completion { -#if TARGET_OS_OSX - [mock addScopes:scopes presentingWindow:OCMOCK_ANY completion:completion]; -#else - [mock addScopes:scopes presentingViewController:OCMOCK_ANY completion:completion]; -#endif -} -- (void)configureMock:(id)mock - forSignInWithHint:(NSString *)hint - additionalScopes:(NSArray *)additionalScopes - completion:(nullable void (^)(GIDSignInResult *_Nullable signInResult, - NSError *_Nullable error))completion { -#if TARGET_OS_OSX - [mock signInWithPresentingWindow:OCMOCK_ANY - hint:hint - additionalScopes:additionalScopes - completion:completion]; -#else - [mock signInWithPresentingViewController:[OCMArg isKindOfClass:[FlutterViewController class]] - hint:hint - additionalScopes:additionalScopes - completion:completion]; -#endif -} - @end diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/.gitignore b/packages/google_sign_in/google_sign_in_ios/example/macos/.gitignore deleted file mode 100644 index 746adbb6b9e1..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Flutter-related -**/Flutter/ephemeral/ -**/Pods/ - -# Xcode-related -**/dgph -**/xcuserdata/ diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Flutter/Flutter-Debug.xcconfig b/packages/google_sign_in/google_sign_in_ios/example/macos/Flutter/Flutter-Debug.xcconfig deleted file mode 100644 index 4b81f9b2d200..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Flutter/Flutter-Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Flutter/Flutter-Release.xcconfig b/packages/google_sign_in/google_sign_in_ios/example/macos/Flutter/Flutter-Release.xcconfig deleted file mode 100644 index 5caa9d1579e4..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Flutter/Flutter-Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "ephemeral/Flutter-Generated.xcconfig" diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Podfile b/packages/google_sign_in/google_sign_in_ios/example/macos/Podfile deleted file mode 100644 index 39a6656a7742..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Podfile +++ /dev/null @@ -1,45 +0,0 @@ -platform :osx, '10.15' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_macos_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end - - pod 'OCMock','3.5' -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_macos_build_settings(target) - end -end diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/project.pbxproj b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 062eccea1799..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,795 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXAggregateTarget section */ - 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; - buildPhases = ( - 33CC111E2044C6BF0003C045 /* ShellScript */, - ); - dependencies = ( - ); - name = "Flutter Assemble"; - productName = FLX; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 330B3F8D2B1E2A5800E6DC3F /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 330B3F8C2B1E2A5800E6DC3F /* GoogleService-Info.plist */; }; - 331C80D8294CF71000263BE5 /* GoogleSignInTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 331C80D7294CF71000263BE5 /* GoogleSignInTests.m */; }; - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; - D7B8415A3D20001DE212873D /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A19720E5189178660264EC3F /* Pods_Runner.framework */; }; - F107B1B7E4ECB85727EC4286 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BD1DCE969A7E7C76D9CF93C /* Pods_RunnerTests.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC10EC2044A3C60003C045; - remoteInfo = Runner; - }; - 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC111A2044C6BA0003C045; - remoteInfo = FLX; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 0BD1DCE969A7E7C76D9CF93C /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 0E1002C336EBB758B6DD1BE4 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 330B3F8C2B1E2A5800E6DC3F /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "GoogleService-Info.plist"; path = "../../../darwin/Tests/GoogleService-Info.plist"; sourceTree = ""; }; - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 331C80D7294CF71000263BE5 /* GoogleSignInTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = GoogleSignInTests.m; path = ../../darwin/Tests/GoogleSignInTests.m; sourceTree = SOURCE_ROOT; }; - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* google_sign_in_ios_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = google_sign_in_ios_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; - 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; - 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; - 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 4626AA70E7BDF77ABE2E7DB0 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 8403A54CFF539C6D4BFB2536 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; - A031586E267538A14E77F28E /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - A19720E5189178660264EC3F /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - B2C32822D6302E2419819672 /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - C3173B998667B2AD47F260FE /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 331C80D2294CF70F00263BE5 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F107B1B7E4ECB85727EC4286 /* Pods_RunnerTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EA2044A3C60003C045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - D7B8415A3D20001DE212873D /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 330B3F8A2B1E27D300E6DC3F /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 330B3F8C2B1E2A5800E6DC3F /* GoogleService-Info.plist */, - 331C80D7294CF71000263BE5 /* GoogleSignInTests.m */, - ); - name = RunnerTests; - path = Runner; - sourceTree = ""; - }; - 33BA886A226E78AF003329D5 /* Configs */ = { - isa = PBXGroup; - children = ( - 33E5194F232828860026EE4D /* AppInfo.xcconfig */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, - ); - path = Configs; - sourceTree = ""; - }; - 33CC10E42044A3C60003C045 = { - isa = PBXGroup; - children = ( - 33FAB671232836740065AC1E /* Runner */, - 33CEB47122A05771004F2AC0 /* Flutter */, - 330B3F8A2B1E27D300E6DC3F /* RunnerTests */, - 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, - A5245CE44A722A1081437B5D /* Pods */, - ); - sourceTree = ""; - }; - 33CC10EE2044A3C60003C045 /* Products */ = { - isa = PBXGroup; - children = ( - 33CC10ED2044A3C60003C045 /* google_sign_in_ios_example.app */, - 331C80D5294CF71000263BE5 /* RunnerTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 33CC11242044D66E0003C045 /* Resources */ = { - isa = PBXGroup; - children = ( - 33CC10F22044A3C60003C045 /* Assets.xcassets */, - 33CC10F42044A3C60003C045 /* MainMenu.xib */, - 33CC10F72044A3C60003C045 /* Info.plist */, - ); - name = Resources; - path = ..; - sourceTree = ""; - }; - 33CEB47122A05771004F2AC0 /* Flutter */ = { - isa = PBXGroup; - children = ( - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - ); - path = Flutter; - sourceTree = ""; - }; - 33FAB671232836740065AC1E /* Runner */ = { - isa = PBXGroup; - children = ( - 33CC10F02044A3C60003C045 /* AppDelegate.swift */, - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, - 33E51913231747F40026EE4D /* DebugProfile.entitlements */, - 33E51914231749380026EE4D /* Release.entitlements */, - 33CC11242044D66E0003C045 /* Resources */, - 33BA886A226E78AF003329D5 /* Configs */, - ); - path = Runner; - sourceTree = ""; - }; - A5245CE44A722A1081437B5D /* Pods */ = { - isa = PBXGroup; - children = ( - 8403A54CFF539C6D4BFB2536 /* Pods-Runner.debug.xcconfig */, - A031586E267538A14E77F28E /* Pods-Runner.release.xcconfig */, - C3173B998667B2AD47F260FE /* Pods-Runner.profile.xcconfig */, - B2C32822D6302E2419819672 /* Pods-RunnerTests.debug.xcconfig */, - 0E1002C336EBB758B6DD1BE4 /* Pods-RunnerTests.release.xcconfig */, - 4626AA70E7BDF77ABE2E7DB0 /* Pods-RunnerTests.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - A19720E5189178660264EC3F /* Pods_Runner.framework */, - 0BD1DCE969A7E7C76D9CF93C /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C80D4294CF70F00263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - 829BC609B118D03CC2221D87 /* [CP] Check Pods Manifest.lock */, - 331C80D1294CF70F00263BE5 /* Sources */, - 331C80D2294CF70F00263BE5 /* Frameworks */, - 331C80D3294CF70F00263BE5 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - 331C80DA294CF71000263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 33CC10EC2044A3C60003C045 /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 728CBB3DC3D62D9A33FE9D0E /* [CP] Check Pods Manifest.lock */, - 33CC10E92044A3C60003C045 /* Sources */, - 33CC10EA2044A3C60003C045 /* Frameworks */, - 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, - 71BCCDB30AA132D041139429 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 33CC11202044C79F0003C045 /* PBXTargetDependency */, - ); - name = Runner; - productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* google_sign_in_ios_example.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 33CC10E52044A3C60003C045 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 1430; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C80D4294CF70F00263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 33CC10EC2044A3C60003C045; - }; - 33CC10EC2044A3C60003C045 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.Sandbox = { - enabled = 1; - }; - }; - }; - 33CC111A2044C6BA0003C045 = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 33CC10E42044A3C60003C045; - productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 33CC10EC2044A3C60003C045 /* Runner */, - 331C80D4294CF70F00263BE5 /* RunnerTests */, - 33CC111A2044C6BA0003C045 /* Flutter Assemble */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C80D3294CF70F00263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 330B3F8D2B1E2A5800E6DC3F /* GoogleService-Info.plist in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10EB2044A3C60003C045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; - }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, - ); - outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; - }; - 71BCCDB30AA132D041139429 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; - 728CBB3DC3D62D9A33FE9D0E /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 829BC609B118D03CC2221D87 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C80D1294CF70F00263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C80D8294CF71000263BE5 /* GoogleSignInTests.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 33CC10E92044A3C60003C045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C80DA294CF71000263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC10EC2044A3C60003C045 /* Runner */; - targetProxy = 331C80D9294CF71000263BE5 /* PBXContainerItemProxy */; - }; - 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; - targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 33CC10F52044A3C60003C045 /* Base */, - ); - name = MainMenu.xib; - path = Runner; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 331C80DB294CF71000263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B2C32822D6302E2419819672 /* Pods-RunnerTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.googleSignInIosExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/google_sign_in_ios_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/google_sign_in_ios_example"; - }; - name = Debug; - }; - 331C80DC294CF71000263BE5 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 0E1002C336EBB758B6DD1BE4 /* Pods-RunnerTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.googleSignInIosExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/google_sign_in_ios_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/google_sign_in_ios_example"; - }; - name = Release; - }; - 331C80DD294CF71000263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4626AA70E7BDF77ABE2E7DB0 /* Pods-RunnerTests.profile.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.googleSignInIosExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/google_sign_in_ios_example.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/google_sign_in_ios_example"; - }; - name = Profile; - }; - 338D0CE9231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Profile; - }; - 338D0CEA231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Profile; - }; - 338D0CEB231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profile; - }; - 33CC10F92044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 33CC10FA2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.15; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - 33CC10FC2044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 33CC10FD2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 33CC111C2044C6BA0003C045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 33CC111D2044C6BA0003C045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C80DE294CF71000263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C80DB294CF71000263BE5 /* Debug */, - 331C80DC294CF71000263BE5 /* Release */, - 331C80DD294CF71000263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10F92044A3C60003C045 /* Debug */, - 33CC10FA2044A3C60003C045 /* Release */, - 338D0CE9231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10FC2044A3C60003C045 /* Debug */, - 33CC10FD2044A3C60003C045 /* Release */, - 338D0CEA231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC111C2044C6BA0003C045 /* Debug */, - 33CC111D2044C6BA0003C045 /* Release */, - 338D0CEB231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 33CC10E52044A3C60003C045 /* Project object */; -} diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index abdbd06b3346..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcworkspace/contents.xcworkspacedata b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/AppDelegate.swift b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/AppDelegate.swift deleted file mode 100644 index 5cec4c48f620..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Cocoa -import FlutterMacOS - -@NSApplicationMain -class AppDelegate: FlutterAppDelegate { - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return true - } -} diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a2ec33f19f11..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" - }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png deleted file mode 100644 index 82b6f9d9a33e..000000000000 Binary files a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png deleted file mode 100644 index 13b35eba55c6..000000000000 Binary files a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png deleted file mode 100644 index 0a3f5fa40fb3..000000000000 Binary files a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png deleted file mode 100644 index bdb57226d5f2..000000000000 Binary files a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png deleted file mode 100644 index f083318e09ca..000000000000 Binary files a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png deleted file mode 100644 index 326c0e72c9d8..000000000000 Binary files a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png deleted file mode 100644 index 2f1632cfddf3..000000000000 Binary files a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and /dev/null differ diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Base.lproj/MainMenu.xib b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Base.lproj/MainMenu.xib deleted file mode 100644 index 80e867a4e06b..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Base.lproj/MainMenu.xib +++ /dev/null @@ -1,343 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/AppInfo.xcconfig b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/AppInfo.xcconfig deleted file mode 100644 index 0eb461887f55..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/AppInfo.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// Application-level settings for the Runner target. -// -// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the -// future. If not, the values below would default to using the project name when this becomes a -// 'flutter create' template. - -// The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = google_sign_in_ios_example - -// The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.googleSignInIosExample - -// The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2023 dev.flutter.plugins. All rights reserved. diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Debug.xcconfig b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Debug.xcconfig deleted file mode 100644 index 36b0fd9464f4..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Debug.xcconfig" -#include "Warnings.xcconfig" diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Release.xcconfig b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Release.xcconfig deleted file mode 100644 index dff4f49561c8..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Release.xcconfig" -#include "Warnings.xcconfig" diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Warnings.xcconfig b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Warnings.xcconfig deleted file mode 100644 index 42bcbf4780b1..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Configs/Warnings.xcconfig +++ /dev/null @@ -1,13 +0,0 @@ -WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES -CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_PRAGMA_PACK = YES -CLANG_WARN_STRICT_PROTOTYPES = YES -CLANG_WARN_COMMA = YES -GCC_WARN_STRICT_SELECTOR_MATCH = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -GCC_WARN_SHADOW = YES -CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/DebugProfile.entitlements b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/DebugProfile.entitlements deleted file mode 100644 index dddb8a30c851..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/DebugProfile.entitlements +++ /dev/null @@ -1,12 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - - diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Info.plist b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Info.plist deleted file mode 100644 index f7026add67e5..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Info.plist +++ /dev/null @@ -1,47 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleURLTypes - - - CFBundleTypeRole - Editor - CFBundleURLSchemes - - com.googleusercontent.apps.479882132969-9i9aqik3jfjd7qhci1nqf0bm2g71rm1u - - - - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - GIDClientID - 479882132969-9i9aqik3jfjd7qhci1nqf0bm2g71rm1u.apps.googleusercontent.com - GIDServerClientID - YOUR_SERVER_CLIENT_ID - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/MainFlutterWindow.swift b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/MainFlutterWindow.swift deleted file mode 100644 index f21908966e95..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/MainFlutterWindow.swift +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Cocoa -import FlutterMacOS - -class MainFlutterWindow: NSWindow { - override func awakeFromNib() { - let flutterViewController = FlutterViewController() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - - RegisterGeneratedPlugins(registry: flutterViewController) - - super.awakeFromNib() - } -} diff --git a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Release.entitlements b/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Release.entitlements deleted file mode 100644 index 852fa1a4728a..000000000000 --- a/packages/google_sign_in/google_sign_in_ios/example/macos/Runner/Release.entitlements +++ /dev/null @@ -1,8 +0,0 @@ - - - - - com.apple.security.app-sandbox - - - diff --git a/packages/google_sign_in/google_sign_in_ios/example/pubspec.yaml b/packages/google_sign_in/google_sign_in_ios/example/pubspec.yaml index e59d361ad67a..611a055fd8c8 100644 --- a/packages/google_sign_in/google_sign_in_ios/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_ios/example/pubspec.yaml @@ -3,8 +3,8 @@ description: Example of Google Sign-In plugin. publish_to: none environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" dependencies: flutter: diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Assets/.gitkeep b/packages/google_sign_in/google_sign_in_ios/ios/Assets/.gitkeep similarity index 100% rename from packages/google_sign_in/google_sign_in_ios/darwin/Assets/.gitkeep rename to packages/google_sign_in/google_sign_in_ios/ios/Assets/.gitkeep diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.h b/packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.h similarity index 74% rename from packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.h rename to packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.h index bbcc72da051d..503b6a4a32e5 100644 --- a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.h +++ b/packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.h @@ -2,14 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if TARGET_OS_OSX -#import -#else #import -#endif #import "messages.g.h" @interface FLTGoogleSignInPlugin : NSObject -- (instancetype)init NS_UNAVAILABLE; + @end diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m b/packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.m similarity index 72% rename from packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m rename to packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.m index 2f7e558ec202..5b79511921f3 100644 --- a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.m +++ b/packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.m @@ -50,37 +50,32 @@ @interface FLTGoogleSignInPlugin () // The contents of GoogleService-Info.plist, if it exists. @property(strong, nullable) NSDictionary *googleServiceProperties; -// The plugin registrar, for querying views. -@property(strong, nonnull) id registrar; +// Redeclared as not a designated initializer. +- (instancetype)init; @end @implementation FLTGoogleSignInPlugin + (void)registerWithRegistrar:(NSObject *)registrar { - FLTGoogleSignInPlugin *instance = [[FLTGoogleSignInPlugin alloc] initWithRegistrar:registrar]; + FLTGoogleSignInPlugin *instance = [[FLTGoogleSignInPlugin alloc] init]; [registrar addApplicationDelegate:instance]; FSIGoogleSignInApiSetup(registrar.messenger, instance); } -- (instancetype)initWithRegistrar:(NSObject *)registrar { - return [self initWithSignIn:GIDSignIn.sharedInstance registrar:registrar]; +- (instancetype)init { + return [self initWithSignIn:GIDSignIn.sharedInstance]; } -- (instancetype)initWithSignIn:(GIDSignIn *)signIn - registrar:(NSObject *)registrar { - return [self initWithSignIn:signIn - registrar:registrar - googleServiceProperties:loadGoogleServiceInfo()]; +- (instancetype)initWithSignIn:(GIDSignIn *)signIn { + return [self initWithSignIn:signIn withGoogleServiceProperties:loadGoogleServiceInfo()]; } - (instancetype)initWithSignIn:(GIDSignIn *)signIn - registrar:(NSObject *)registrar - googleServiceProperties:(nullable NSDictionary *)googleServiceProperties { + withGoogleServiceProperties:(nullable NSDictionary *)googleServiceProperties { self = [super init]; if (self) { _signIn = signIn; - _registrar = registrar; _googleServiceProperties = googleServiceProperties; // On the iOS simulator, we get "Broken pipe" errors after sign-in for some @@ -93,19 +88,9 @@ - (instancetype)initWithSignIn:(GIDSignIn *)signIn #pragma mark - protocol -#if TARGET_OS_IOS - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDictionary *)options { return [self.signIn handleURL:url]; } -#else -- (BOOL)handleOpenURLs:(NSArray *)urls { - BOOL handled = NO; - for (NSURL *url in urls) { - handled = handled || [self.signIn handleURL:url]; - } - return handled; -} -#endif #pragma mark - FSIGoogleSignInApi @@ -149,21 +134,23 @@ - (void)signInWithCompletion:(nonnull void (^)(FSIUserData *_Nullable, self.signIn.configuration = self.configuration; } - [self signInWithHint:nil - additionalScopes:self.requestedScopes.allObjects - completion:^(GIDSignInResult *_Nullable signInResult, NSError *_Nullable error) { - GIDGoogleUser *user; - NSString *serverAuthCode; - if (signInResult) { - user = signInResult.user; - serverAuthCode = signInResult.serverAuthCode; - } - - [self didSignInForUser:user - withServerAuthCode:serverAuthCode - completion:completion - error:error]; - }]; + [self.signIn signInWithPresentingViewController:[self topViewController] + hint:nil + additionalScopes:self.requestedScopes.allObjects + completion:^(GIDSignInResult *_Nullable signInResult, + NSError *_Nullable error) { + GIDGoogleUser *user; + NSString *serverAuthCode; + if (signInResult) { + user = signInResult.user; + serverAuthCode = signInResult.serverAuthCode; + } + + [self didSignInForUser:user + withServerAuthCode:serverAuthCode + completion:completion + error:error]; + }]; } @catch (NSException *e) { completion(nil, [FlutterError errorWithCode:@"google_sign_in" message:e.reason details:e.name]); [e raise]; @@ -209,67 +196,51 @@ - (void)requestScopes:(nonnull NSArray *)scopes message:@"No account to grant scopes." details:nil]); } - [self addScopes:requestedScopes.allObjects - completion:^(GIDSignInResult *_Nullable signInResult, NSError *_Nullable addedScopeError) { - BOOL granted = NO; - FlutterError *error = nil; - - if ([addedScopeError.domain isEqualToString:kGIDSignInErrorDomain] && - addedScopeError.code == kGIDSignInErrorCodeMismatchWithCurrentUser) { - error = [FlutterError errorWithCode:@"mismatch_user" - message:@"There is an operation on a previous " - @"user. Try signing in again." - details:nil]; - } else if ([addedScopeError.domain isEqualToString:kGIDSignInErrorDomain] && - addedScopeError.code == kGIDSignInErrorCodeScopesAlreadyGranted) { - // Scopes already granted, report success. - granted = YES; - } else if (signInResult.user) { - NSSet *grantedScopes = - [NSSet setWithArray:signInResult.user.grantedScopes]; - granted = [requestedScopes isSubsetOfSet:grantedScopes]; - } - completion(error == nil ? @(granted) : nil, error); - }]; + [currentUser addScopes:requestedScopes.allObjects + presentingViewController:[self topViewController] + completion:^(GIDSignInResult *_Nullable signInResult, + NSError *_Nullable addedScopeError) { + BOOL granted = NO; + FlutterError *error = nil; + + if ([addedScopeError.domain isEqualToString:kGIDSignInErrorDomain] && + addedScopeError.code == kGIDSignInErrorCodeMismatchWithCurrentUser) { + error = + [FlutterError errorWithCode:@"mismatch_user" + message:@"There is an operation on a previous " + @"user. Try signing in again." + details:nil]; + } else if ([addedScopeError.domain isEqualToString:kGIDSignInErrorDomain] && + addedScopeError.code == + kGIDSignInErrorCodeScopesAlreadyGranted) { + // Scopes already granted, report success. + granted = YES; + } else if (signInResult.user) { + NSSet *grantedScopes = + [NSSet setWithArray:signInResult.user.grantedScopes]; + granted = [requestedScopes isSubsetOfSet:grantedScopes]; + } + completion(error == nil ? @(granted) : nil, error); + }]; } @catch (NSException *e) { completion(nil, [FlutterError errorWithCode:@"request_scopes" message:e.reason details:e.name]); } } -#pragma mark - private methods +#pragma mark - protocol -// Wraps the iOS and macOS sign in display methods. -- (void)signInWithHint:(nullable NSString *)hint - additionalScopes:(nullable NSArray *)additionalScopes - completion:(nullable void (^)(GIDSignInResult *_Nullable signInResult, - NSError *_Nullable error))completion { -#if TARGET_OS_OSX - [self.signIn signInWithPresentingWindow:self.registrar.view.window - hint:hint - additionalScopes:additionalScopes - completion:completion]; -#else - [self.signIn signInWithPresentingViewController:[self topViewController] - hint:hint - additionalScopes:additionalScopes - completion:completion]; -#endif +- (void)signIn:(GIDSignIn *)signIn presentViewController:(UIViewController *)viewController { + UIViewController *rootViewController = + [UIApplication sharedApplication].delegate.window.rootViewController; + [rootViewController presentViewController:viewController animated:YES completion:nil]; } -// Wraps the iOS and macOS scope addition methods. -- (void)addScopes:(NSArray *)scopes - completion:(nullable void (^)(GIDSignInResult *_Nullable signInResult, - NSError *_Nullable error))completion { - GIDGoogleUser *currentUser = self.signIn.currentUser; -#if TARGET_OS_OSX - [currentUser addScopes:scopes presentingWindow:self.registrar.view.window completion:completion]; -#else - [currentUser addScopes:scopes - presentingViewController:[self topViewController] - completion:completion]; -#endif +- (void)signIn:(GIDSignIn *)signIn dismissViewController:(UIViewController *)viewController { + [viewController dismissViewControllerAnimated:YES completion:nil]; } +#pragma mark - private methods + /// @return @c nil if GoogleService-Info.plist not found and clientId is not provided. - (GIDConfiguration *)configurationWithClientIdArgument:(id)clientIDArg serverClientIdArgument:(id)serverClientIDArg @@ -328,8 +299,6 @@ - (void)didSignInForUser:(GIDGoogleUser *)user } } -#if TARGET_OS_IOS - - (UIViewController *)topViewController { #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wdeprecated-declarations" @@ -368,6 +337,4 @@ - (UIViewController *)topViewControllerFromViewController:(UIViewController *)vi return viewController; } -#endif - @end diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.modulemap b/packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.modulemap similarity index 100% rename from packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin.modulemap rename to packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin.modulemap diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin_Test.h b/packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin_Test.h similarity index 75% rename from packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin_Test.h rename to packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin_Test.h index b145d028ad97..fc18c9b9e513 100644 --- a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/FLTGoogleSignInPlugin_Test.h +++ b/packages/google_sign_in/google_sign_in_ios/ios/Classes/FLTGoogleSignInPlugin_Test.h @@ -29,17 +29,12 @@ NS_ASSUME_NONNULL_BEGIN // sign in, sign out, and requesting additional scopes. @property(strong, readonly) GIDSignIn *signIn; -/// Inject @c FlutterPluginRegistrar for testing. -- (instancetype)initWithRegistrar:(NSObject *)registrar; - /// Inject @c GIDSignIn for testing. -- (instancetype)initWithSignIn:(GIDSignIn *)signIn - registrar:(NSObject *)registrar; +- (instancetype)initWithSignIn:(GIDSignIn *)signIn; /// Inject @c GIDSignIn and @c googleServiceProperties for testing. - (instancetype)initWithSignIn:(GIDSignIn *)signIn - registrar:(NSObject *)registrar - googleServiceProperties:(nullable NSDictionary *)googleServiceProperties + withGoogleServiceProperties:(nullable NSDictionary *)googleServiceProperties NS_DESIGNATED_INITIALIZER; @end diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/google_sign_in_ios-umbrella.h b/packages/google_sign_in/google_sign_in_ios/ios/Classes/google_sign_in_ios-umbrella.h similarity index 100% rename from packages/google_sign_in/google_sign_in_ios/darwin/Classes/google_sign_in_ios-umbrella.h rename to packages/google_sign_in/google_sign_in_ios/ios/Classes/google_sign_in_ios-umbrella.h diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/messages.g.h b/packages/google_sign_in/google_sign_in_ios/ios/Classes/messages.g.h similarity index 100% rename from packages/google_sign_in/google_sign_in_ios/darwin/Classes/messages.g.h rename to packages/google_sign_in/google_sign_in_ios/ios/Classes/messages.g.h diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/Classes/messages.g.m b/packages/google_sign_in/google_sign_in_ios/ios/Classes/messages.g.m similarity index 100% rename from packages/google_sign_in/google_sign_in_ios/darwin/Classes/messages.g.m rename to packages/google_sign_in/google_sign_in_ios/ios/Classes/messages.g.m diff --git a/packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios.podspec b/packages/google_sign_in/google_sign_in_ios/ios/google_sign_in_ios.podspec similarity index 87% rename from packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios.podspec rename to packages/google_sign_in/google_sign_in_ios/ios/google_sign_in_ios.podspec index a9a0244d19a1..9658184c8839 100644 --- a/packages/google_sign_in/google_sign_in_ios/darwin/google_sign_in_ios.podspec +++ b/packages/google_sign_in/google_sign_in_ios/ios/google_sign_in_ios.podspec @@ -15,11 +15,9 @@ Enables Google Sign-In in Flutter apps. s.source_files = 'Classes/**/*.{h,m}' s.public_header_files = 'Classes/**/*.h' s.module_map = 'Classes/FLTGoogleSignInPlugin.modulemap' + s.dependency 'Flutter' s.dependency 'GoogleSignIn', '~> 7.0' s.static_framework = true - s.ios.dependency 'Flutter' - s.osx.dependency 'FlutterMacOS' - s.ios.deployment_target = '11.0' - s.osx.deployment_target = '10.15' + s.platform = :ios, '11.0' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } end diff --git a/packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart b/packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart index c540ee7b60f8..2baf9af82ad8 100644 --- a/packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart +++ b/packages/google_sign_in/google_sign_in_ios/pigeons/messages.dart @@ -7,8 +7,8 @@ import 'package:pigeon/pigeon.dart'; @ConfigurePigeon(PigeonOptions( dartOut: 'lib/src/messages.g.dart', objcOptions: ObjcOptions(prefix: 'FSI'), - objcHeaderOut: 'darwin/Classes/messages.g.h', - objcSourceOut: 'darwin/Classes/messages.g.m', + objcHeaderOut: 'ios/Classes/messages.g.h', + objcSourceOut: 'ios/Classes/messages.g.m', copyrightHeader: 'pigeons/copyright.txt', )) diff --git a/packages/google_sign_in/google_sign_in_ios/pubspec.yaml b/packages/google_sign_in/google_sign_in_ios/pubspec.yaml index d3a6316b651c..4506885bf6a2 100644 --- a/packages/google_sign_in/google_sign_in_ios/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_ios/pubspec.yaml @@ -2,11 +2,11 @@ name: google_sign_in_ios description: iOS implementation of the google_sign_in plugin. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 5.7.1 +version: 5.6.5 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" flutter: plugin: @@ -15,16 +15,12 @@ flutter: ios: dartPluginClass: GoogleSignInIOS pluginClass: FLTGoogleSignInPlugin - sharedDarwinSource: true - macos: - dartPluginClass: GoogleSignInIOS - pluginClass: FLTGoogleSignInPlugin - sharedDarwinSource: true dependencies: flutter: sdk: flutter google_sign_in_platform_interface: ^2.2.0 + pigeon: ^11.0.1 dev_dependencies: build_runner: ^2.4.6 @@ -32,8 +28,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.3 - pigeon: ^11.0.1 + mockito: 5.4.1 topics: - authentication @@ -41,8 +36,7 @@ topics: # The example deliberately includes limited-use secrets. false_secrets: - - /darwin/Tests/GoogleService-Info.plist - - /darwin/Tests/GoogleSignInTests.m - /example/ios/Runner/Info.plist + - /example/ios/RunnerTests/GoogleService-Info.plist + - /example/ios/RunnerTests/GoogleSignInTests.m - /example/lib/main.dart - - /example/macos/Runner/Info.plist diff --git a/packages/google_sign_in/google_sign_in_ios/test/google_sign_in_ios_test.mocks.dart b/packages/google_sign_in/google_sign_in_ios/test/google_sign_in_ios_test.mocks.dart index 08b6b389a882..30c420d7ad07 100644 --- a/packages/google_sign_in/google_sign_in_ios/test/google_sign_in_ios_test.mocks.dart +++ b/packages/google_sign_in/google_sign_in_ios/test/google_sign_in_ios_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in google_sign_in_ios/test/google_sign_in_ios_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -12,8 +14,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -58,7 +58,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future<_i2.UserData> signInSilently() => (super.noSuchMethod( Invocation.method( @@ -73,7 +72,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { ), )), ) as _i3.Future<_i2.UserData>); - @override _i3.Future<_i2.UserData> signIn() => (super.noSuchMethod( Invocation.method( @@ -88,7 +86,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { ), )), ) as _i3.Future<_i2.UserData>); - @override _i3.Future<_i2.TokenData> getAccessToken() => (super.noSuchMethod( Invocation.method( @@ -103,7 +100,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { ), )), ) as _i3.Future<_i2.TokenData>); - @override _i3.Future signOut() => (super.noSuchMethod( Invocation.method( @@ -113,7 +109,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future disconnect() => (super.noSuchMethod( Invocation.method( @@ -123,7 +118,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future isSignedIn() => (super.noSuchMethod( Invocation.method( @@ -132,7 +126,6 @@ class MockGoogleSignInApi extends _i1.Mock implements _i2.GoogleSignInApi { ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i3.Future requestScopes(List? arg_scopes) => (super.noSuchMethod( diff --git a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md index eba3544dd3b7..ab6285bce82c 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_platform_interface/CHANGELOG.md @@ -1,7 +1,6 @@ -## 2.4.3 +## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Drop dependency on `package:quiver`. ## 2.4.2 diff --git a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart index 5c74450b4806..13568c80b330 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart +++ b/packages/google_sign_in/google_sign_in_platform_interface/lib/src/types.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'package:flutter/widgets.dart'; +import 'package:quiver/core.dart'; /// Default configuration options to use when signing in. /// @@ -131,8 +132,8 @@ class GoogleSignInUserData { @override // TODO(stuartmorgan): Make this class immutable in the next breaking change. // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => - Object.hash(displayName, email, id, photoUrl, idToken, serverAuthCode); + int get hashCode => hashObjects( + [displayName, email, id, photoUrl, idToken, serverAuthCode]); @override // TODO(stuartmorgan): Make this class immutable in the next breaking change. @@ -175,7 +176,7 @@ class GoogleSignInTokenData { @override // TODO(stuartmorgan): Make this class immutable in the next breaking change. // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => Object.hash(idToken, accessToken, serverAuthCode); + int get hashCode => hash3(idToken, accessToken, serverAuthCode); @override // TODO(stuartmorgan): Make this class immutable in the next breaking change. diff --git a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml index 883d08957d38..3eeb73478495 100644 --- a/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/google_sign_i issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.4.3 +version: 2.4.2 environment: sdk: ">=3.0.0 <4.0.0" @@ -14,11 +14,12 @@ dependencies: flutter: sdk: flutter plugin_platform_interface: ^2.1.0 + quiver: ^3.0.0 dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - authentication diff --git a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md index a5cbeea796a6..90aeabceebea 100644 --- a/packages/google_sign_in/google_sign_in_web/CHANGELOG.md +++ b/packages/google_sign_in/google_sign_in_web/CHANGELOG.md @@ -1,22 +1,3 @@ -## 0.12.3+1 - -* Updates `FlexHtmlElementView` (the widget backing `renderButton`) to not - rely on web engine knowledge (a platform view CSS selector) to operate. - -## 0.12.3 - -* Migrates to `package:web`. -* Updates minimum supported SDK version to Flutter 3.16.0/Dart 3.2.0. - -## 0.12.2+1 - -* Re-publishes `0.12.2` with a small fix to the CodeClient initialization. - -## 0.12.2 (withdrawn) - -* Adds server auth code retrieval to google_sign_in_web. -* Adds `web_only` library to access web-only methods more easily. - ## 0.12.1 * Enables FedCM on browsers that support this authentication mechanism. diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test.dart index 839c9abb5f78..555b1711bd05 100644 --- a/packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test.dart +++ b/packages/google_sign_in/google_sign_in_web/example/integration_test/flexible_size_html_element_view_test.dart @@ -9,7 +9,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:google_sign_in_web/src/flexible_size_html_element_view.dart'; import 'package:integration_test/integration_test.dart'; -import 'package:web/web.dart' as web; + +import 'src/dom.dart'; /// Used to keep track of the number of HtmlElementView factories the test has registered. int widgetFactoryNumber = 0; @@ -22,12 +23,12 @@ void main() { widgetFactoryNumber++; }); - testWidgets('empty case, calls onElementCreated', + testWidgets('empty case, calls onPlatformViewCreated', (WidgetTester tester) async { - final Completer viewCreatedCompleter = Completer(); + final Completer viewCreatedCompleter = Completer(); - await pumpResizableWidget(tester, onElementCreated: (Object view) { - viewCreatedCompleter.complete(view); + await pumpResizableWidget(tester, onPlatformViewCreated: (int id) { + viewCreatedCompleter.complete(id); }); await tester.pumpAndSettle(); @@ -53,13 +54,12 @@ void main() { (WidgetTester tester) async { const Size childSize = Size(300, 40); - final web.HTMLDivElement resizable = - web.document.createElement('div') as web.HTMLDivElement; + final DomHtmlElement resizable = document.createElement('div'); resize(resizable, childSize); final Element element = await pumpResizableWidget( tester, - onElementCreated: injectElement(resizable), + onPlatformViewCreated: injectElement(resizable), ); await tester.pumpAndSettle(); @@ -73,14 +73,13 @@ void main() { const Size initialSize = Size(160, 100); const Size newSize = Size(300, 40); - final web.HTMLDivElement resizable = - web.document.createElement('div') as web.HTMLDivElement; + final DomHtmlElement resizable = document.createElement('div'); resize(resizable, newSize); final Element element = await pumpResizableWidget( tester, initialSize: initialSize, - onElementCreated: injectElement(resizable), + onPlatformViewCreated: injectElement(resizable), ); await tester.pumpAndSettle(); @@ -95,15 +94,14 @@ void main() { final Size expandedSize = initialSize * 2; final Size contractedSize = initialSize / 2; - final web.HTMLDivElement resizable = web.document.createElement('div') - as web.HTMLDivElement + final DomHtmlElement resizable = document.createElement('div') ..setAttribute( 'style', 'width: 100%; height: 100%; background: #fabada;'); final Element element = await pumpResizableWidget( tester, initialSize: initialSize, - onElementCreated: injectElement(resizable), + onPlatformViewCreated: injectElement(resizable), ); await tester.pumpAndSettle(); @@ -134,12 +132,12 @@ void main() { /// Injects a ResizableFromJs widget into the `tester`. Future pumpResizableWidget( WidgetTester tester, { - void Function(Object)? onElementCreated, + void Function(int)? onPlatformViewCreated, Size? initialSize, }) async { await tester.pumpWidget(ResizableFromJs( instanceId: widgetFactoryNumber, - onElementCreated: onElementCreated, + onPlatformViewCreated: onPlatformViewCreated, initialSize: initialSize, )); // Needed for JS to have time to kick-off. @@ -155,15 +153,14 @@ Future pumpResizableWidget( class ResizableFromJs extends StatelessWidget { ResizableFromJs({ required this.instanceId, - this.onElementCreated, + this.onPlatformViewCreated, this.initialSize, super.key, }) { ui_web.platformViewRegistry.registerViewFactory( 'resizable_from_js_$instanceId', (int viewId) { - final web.HTMLDivElement element = - web.document.createElement('div') as web.HTMLDivElement; + final DomHtmlElement element = document.createElement('div'); element.setAttribute('style', 'width: 100%; height: 100%; overflow: hidden; background: red;'); element.id = 'test_element_$viewId'; @@ -173,7 +170,7 @@ class ResizableFromJs extends StatelessWidget { } final int instanceId; - final void Function(Object)? onElementCreated; + final void Function(int)? onPlatformViewCreated; final Size? initialSize; @override @@ -184,7 +181,7 @@ class ResizableFromJs extends StatelessWidget { child: FlexHtmlElementView( viewType: 'resizable_from_js_$instanceId', key: Key('resizable_from_js_$instanceId'), - onElementCreated: onElementCreated, + onPlatformViewCreated: onPlatformViewCreated, initialSize: initialSize ?? const Size(640, 480), ), ), @@ -194,14 +191,16 @@ class ResizableFromJs extends StatelessWidget { } /// Resizes `resizable` to `size`. -void resize(web.HTMLElement resizable, Size size) { +void resize(DomHtmlElement resizable, Size size) { resizable.setAttribute('style', 'width: ${size.width}px; height: ${size.height}px; background: #fabada'); } -/// Returns an `onElementCreated` callback that injects [element]. -ElementCreatedCallback injectElement(web.HTMLElement element) { - return (Object root) { - (root as web.HTMLElement).appendChild(element); +/// Returns a function that can be used to inject `element` in `onPlatformViewCreated` callbacks. +void Function(int) injectElement(DomHtmlElement element) { + return (int viewId) { + final DomHtmlElement root = + document.querySelector('#test_element_$viewId')!; + root.appendChild(element); }; } diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/google_sign_in_web_test.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/google_sign_in_web_test.dart index 1b5f11d2f9d2..fdea1b7f7ca7 100644 --- a/packages/google_sign_in/google_sign_in_web/example/integration_test/google_sign_in_web_test.dart +++ b/packages/google_sign_in/google_sign_in_web/example/integration_test/google_sign_in_web_test.dart @@ -13,9 +13,9 @@ import 'package:google_sign_in_web/src/people.dart'; import 'package:integration_test/integration_test.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart' as mockito; -import 'package:web/web.dart' as web; import 'google_sign_in_web_test.mocks.dart'; +import 'src/dom.dart'; import 'src/person.dart'; // Mock GisSdkClient so we can simulate any response from the JS side. @@ -36,12 +36,12 @@ void main() { expect(plugin.autoDetectedClientId, isNull); // Add it to the test page now, and try again - final web.HTMLMetaElement meta = - web.document.createElement('meta') as web.HTMLMetaElement + final DomHtmlMetaElement meta = + document.createElement('meta') as DomHtmlMetaElement ..name = clientIdMetaName ..content = expectedClientId; - web.document.head!.appendChild(meta); + document.head.appendChild(meta); final GoogleSignInPlugin another = GoogleSignInPlugin( debugOverrideLoader: true, @@ -250,24 +250,6 @@ void main() { expect(arguments.elementAt(1), someAccessToken); }); }); - - group('requestServerAuthCode', () { - const String someAuthCode = '50m3_4u7h_c0d3'; - - setUp(() { - plugin.initWithParams(options); - }); - - testWidgets('passes-through call to gis client', (_) async { - mockito - .when(mockGis.requestServerAuthCode()) - .thenAnswer((_) => Future.value(someAuthCode)); - - final String? serverAuthCode = await plugin.requestServerAuthCode(); - - expect(serverAuthCode, someAuthCode); - }); - }); }); group('userDataEvents', () { diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/google_sign_in_web_test.mocks.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/google_sign_in_web_test.mocks.dart index b085f2a4f978..35ef487c9bb5 100644 --- a/packages/google_sign_in/google_sign_in_web/example/integration_test/google_sign_in_web_test.mocks.dart +++ b/packages/google_sign_in/google_sign_in_web/example/integration_test/google_sign_in_web_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in google_sign_in_web_integration_tests/integration_test/google_sign_in_web_test.dart. // Do not manually edit this file. @@ -15,8 +15,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -49,7 +47,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { returnValueForMissingStub: _i4.Future<_i2.GoogleSignInUserData?>.value(), ) as _i4.Future<_i2.GoogleSignInUserData?>); - @override _i4.Future renderButton( Object? parent, @@ -66,17 +63,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - - @override - _i4.Future requestServerAuthCode() => (super.noSuchMethod( - Invocation.method( - #requestServerAuthCode, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - @override _i4.Future<_i2.GoogleSignInUserData?> signIn() => (super.noSuchMethod( Invocation.method( @@ -87,7 +73,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { returnValueForMissingStub: _i4.Future<_i2.GoogleSignInUserData?>.value(), ) as _i4.Future<_i2.GoogleSignInUserData?>); - @override _i2.GoogleSignInTokenData getTokens() => (super.noSuchMethod( Invocation.method( @@ -109,7 +94,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { ), ), ) as _i2.GoogleSignInTokenData); - @override _i4.Future signOut() => (super.noSuchMethod( Invocation.method( @@ -119,7 +103,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future disconnect() => (super.noSuchMethod( Invocation.method( @@ -129,7 +112,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future isSignedIn() => (super.noSuchMethod( Invocation.method( @@ -139,7 +121,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { returnValue: _i4.Future.value(false), returnValueForMissingStub: _i4.Future.value(false), ) as _i4.Future); - @override _i4.Future clearAuthCache() => (super.noSuchMethod( Invocation.method( @@ -149,7 +130,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future requestScopes(List? scopes) => (super.noSuchMethod( Invocation.method( @@ -159,7 +139,6 @@ class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { returnValue: _i4.Future.value(false), returnValueForMissingStub: _i4.Future.value(false), ) as _i4.Future); - @override _i4.Future canAccessScopes( List? scopes, diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/src/dom.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/src/dom.dart new file mode 100644 index 000000000000..58bbe2138d90 --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/example/integration_test/src/dom.dart @@ -0,0 +1,70 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +/* +// DOM shim. This file contains everything we need from the DOM API written as +// @staticInterop, so we don't need dart:html +// https://developer.mozilla.org/en-US/docs/Web/API/ +// +// (To be replaced by `package:web`) +*/ + +import 'package:js/js.dart'; + +/// Document interface +@JS() +@staticInterop +abstract class DomHtmlDocument {} + +/// Some methods of document +extension DomHtmlDocumentExtension on DomHtmlDocument { + /// document.head + external DomHtmlElement get head; + + /// document.createElement + external DomHtmlElement createElement(String tagName); + + /// document.querySelector + external DomHtmlElement? querySelector(String selector); +} + +/// An instance of an HTMLElement +@JS() +@staticInterop +abstract class DomHtmlElement {} + +/// (Some) methods of HtmlElement +extension DomHtmlElementExtension on DomHtmlElement { + external String get id; + external set id(String id); + external set innerText(String innerText); + external String? getAttribute(String attributeName); + + /// Node.appendChild + external DomHtmlElement appendChild(DomHtmlElement child); + + /// Element.setAttribute + external void setAttribute(String name, Object value); + + /// Element.remove + external void remove(); +} + +/// An instance of an HTMLMetaElement +@JS() +@staticInterop +abstract class DomHtmlMetaElement extends DomHtmlElement {} + +/// Some methods exclusive of Script elements +extension DomHtmlMetaElementExtension on DomHtmlMetaElement { + external set name(String name); + external set content(String content); +} + +// Getters + +/// window.document +@JS() +@staticInterop +external DomHtmlDocument get document; diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/src/jsify_as.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/src/jsify_as.dart index fe8247594fd6..82547b284fe0 100644 --- a/packages/google_sign_in/google_sign_in_web/example/integration_test/src/jsify_as.dart +++ b/packages/google_sign_in/google_sign_in_web/example/integration_test/src/jsify_as.dart @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_interop'; +import 'package:js/js_util.dart' as js_util; /// Converts a [data] object into a JS Object of type `T`. T jsifyAs(Map data) { - return data.jsify() as T; + return js_util.jsify(data) as T; } diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.dart deleted file mode 100644 index 508e291bf2a9..000000000000 --- a/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.dart +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter_test/flutter_test.dart'; -import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; -import 'package:google_sign_in_web/google_sign_in_web.dart' - show GoogleSignInPlugin; -import 'package:google_sign_in_web/src/gis_client.dart'; -import 'package:google_sign_in_web/web_only.dart' as web; -import 'package:integration_test/integration_test.dart'; -import 'package:mockito/annotations.dart'; -import 'package:mockito/mockito.dart' as mockito; - -import 'web_only_test.mocks.dart'; - -// Mock GisSdkClient so we can simulate any response from the JS side. -@GenerateMocks([], customMocks: >[ - MockSpec(onMissingStub: OnMissingStub.returnDefault), -]) -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - group('non-web plugin instance', () { - setUp(() { - GoogleSignInPlatform.instance = NonWebImplementation(); - }); - - testWidgets('renderButton throws', (WidgetTester _) async { - expect(() { - web.renderButton(); - }, throwsAssertionError); - }); - - testWidgets('requestServerAuthCode throws', (WidgetTester _) async { - expect(() async { - await web.requestServerAuthCode(); - }, throwsAssertionError); - }); - }); - - group('web plugin instance', () { - const String someAuthCode = '50m3_4u7h_c0d3'; - late MockGisSdkClient mockGis; - - setUp(() { - mockGis = MockGisSdkClient(); - GoogleSignInPlatform.instance = GoogleSignInPlugin( - debugOverrideLoader: true, - debugOverrideGisSdkClient: mockGis, - )..initWithParams( - const SignInInitParameters( - clientId: 'does-not-matter', - ), - ); - }); - - testWidgets('call reaches GIS API', (WidgetTester _) async { - mockito - .when(mockGis.requestServerAuthCode()) - .thenAnswer((_) => Future.value(someAuthCode)); - - final String? serverAuthCode = await web.requestServerAuthCode(); - - expect(serverAuthCode, someAuthCode); - }); - }); -} - -/// Fake non-web implementation used to verify that the web_only methods -/// throw when the wrong type of instance is configured. -class NonWebImplementation extends GoogleSignInPlatform {} diff --git a/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.mocks.dart b/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.mocks.dart deleted file mode 100644 index 6749c671ebd0..000000000000 --- a/packages/google_sign_in/google_sign_in_web/example/integration_test/web_only_test.mocks.dart +++ /dev/null @@ -1,179 +0,0 @@ -// Mocks generated by Mockito 5.4.3 from annotations -// in google_sign_in_web_integration_tests/integration_test/web_only_test.dart. -// Do not manually edit this file. - -// ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i4; - -import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart' - as _i2; -import 'package:google_sign_in_web/src/button_configuration.dart' as _i5; -import 'package:google_sign_in_web/src/gis_client.dart' as _i3; -import 'package:mockito/mockito.dart' as _i1; - -// ignore_for_file: type=lint -// ignore_for_file: avoid_redundant_argument_values -// ignore_for_file: avoid_setters_without_getters -// ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package -// ignore_for_file: implementation_imports -// ignore_for_file: invalid_use_of_visible_for_testing_member -// ignore_for_file: prefer_const_constructors -// ignore_for_file: unnecessary_parenthesis -// ignore_for_file: camel_case_types -// ignore_for_file: subtype_of_sealed_class - -class _FakeGoogleSignInTokenData_0 extends _i1.SmartFake - implements _i2.GoogleSignInTokenData { - _FakeGoogleSignInTokenData_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); -} - -/// A class which mocks [GisSdkClient]. -/// -/// See the documentation for Mockito's code generation for more information. -class MockGisSdkClient extends _i1.Mock implements _i3.GisSdkClient { - @override - _i4.Future<_i2.GoogleSignInUserData?> signInSilently() => (super.noSuchMethod( - Invocation.method( - #signInSilently, - [], - ), - returnValue: _i4.Future<_i2.GoogleSignInUserData?>.value(), - returnValueForMissingStub: - _i4.Future<_i2.GoogleSignInUserData?>.value(), - ) as _i4.Future<_i2.GoogleSignInUserData?>); - - @override - _i4.Future renderButton( - Object? parent, - _i5.GSIButtonConfiguration? options, - ) => - (super.noSuchMethod( - Invocation.method( - #renderButton, - [ - parent, - options, - ], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future requestServerAuthCode() => (super.noSuchMethod( - Invocation.method( - #requestServerAuthCode, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future<_i2.GoogleSignInUserData?> signIn() => (super.noSuchMethod( - Invocation.method( - #signIn, - [], - ), - returnValue: _i4.Future<_i2.GoogleSignInUserData?>.value(), - returnValueForMissingStub: - _i4.Future<_i2.GoogleSignInUserData?>.value(), - ) as _i4.Future<_i2.GoogleSignInUserData?>); - - @override - _i2.GoogleSignInTokenData getTokens() => (super.noSuchMethod( - Invocation.method( - #getTokens, - [], - ), - returnValue: _FakeGoogleSignInTokenData_0( - this, - Invocation.method( - #getTokens, - [], - ), - ), - returnValueForMissingStub: _FakeGoogleSignInTokenData_0( - this, - Invocation.method( - #getTokens, - [], - ), - ), - ) as _i2.GoogleSignInTokenData); - - @override - _i4.Future signOut() => (super.noSuchMethod( - Invocation.method( - #signOut, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future disconnect() => (super.noSuchMethod( - Invocation.method( - #disconnect, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future isSignedIn() => (super.noSuchMethod( - Invocation.method( - #isSignedIn, - [], - ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i4.Future clearAuthCache() => (super.noSuchMethod( - Invocation.method( - #clearAuthCache, - [], - ), - returnValue: _i4.Future.value(), - returnValueForMissingStub: _i4.Future.value(), - ) as _i4.Future); - - @override - _i4.Future requestScopes(List? scopes) => (super.noSuchMethod( - Invocation.method( - #requestScopes, - [scopes], - ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); - - @override - _i4.Future canAccessScopes( - List? scopes, - String? accessToken, - ) => - (super.noSuchMethod( - Invocation.method( - #canAccessScopes, - [ - scopes, - accessToken, - ], - ), - returnValue: _i4.Future.value(false), - returnValueForMissingStub: _i4.Future.value(false), - ) as _i4.Future); -} diff --git a/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml index bdcfdd798179..61a2f47b7e22 100644 --- a/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/example/pubspec.yaml @@ -2,14 +2,14 @@ name: google_sign_in_web_integration_tests publish_to: none environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" dependencies: cupertino_icons: ^1.0.2 flutter: sdk: flutter - google_identity_services_web: ^0.3.0 + google_identity_services_web: ^0.2.1 google_sign_in_platform_interface: ^2.4.0 google_sign_in_web: path: ../ @@ -21,8 +21,8 @@ dev_dependencies: http: ">=0.13.0 <2.0.0" integration_test: sdk: flutter - mockito: 5.4.3 - web: ">=0.3.0 <0.5.0" + js: ^0.6.3 + mockito: 5.4.1 flutter: uses-material-design: true diff --git a/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart b/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart index d2cf1420da7c..cee94d345f02 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/google_sign_in_web.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:js_interop'; +import 'dart:html' as html; import 'dart:ui_web' as ui_web; import 'package:flutter/foundation.dart' show visibleForTesting, kDebugMode; @@ -13,9 +13,9 @@ import 'package:flutter/widgets.dart'; import 'package:flutter_web_plugins/flutter_web_plugins.dart'; import 'package:google_identity_services_web/loader.dart' as loader; import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; -import 'package:web/web.dart' as web; import 'src/button_configuration.dart' show GSIButtonConfiguration; +import 'src/dom.dart'; import 'src/flexible_size_html_element_view.dart'; import 'src/gis_client.dart'; @@ -54,7 +54,7 @@ class GoogleSignInPlugin extends GoogleSignInPlatform { }) : _gisSdkClient = debugOverrideGisSdkClient, _userDataController = debugOverrideUserDataController ?? StreamController.broadcast() { - autoDetectedClientId = web.document + autoDetectedClientId = html .querySelector(clientIdMetaSelector) ?.getAttribute(clientIdAttributeName); @@ -175,7 +175,7 @@ class GoogleSignInPlugin extends GoogleSignInPlatform { ui_web.platformViewRegistry.registerViewFactory( 'gsi_login_button', (int viewId) { - final web.Element element = web.document.createElement('div'); + final DomElement element = createDomElement('div'); element.setAttribute('style', 'width: 100%; height: 100%; overflow: hidden; display: flex; flex-wrap: wrap; align-content: center; justify-content: center;'); element.id = 'sign_in_button_$viewId'; @@ -195,8 +195,12 @@ class GoogleSignInPlugin extends GoogleSignInPlatform { if (snapshot.hasData) { return FlexHtmlElementView( viewType: 'gsi_login_button', - onElementCreated: (Object element) { - _gisClient.renderButton(element, config); + onPlatformViewCreated: (int viewId) { + final DomElement? element = + domDocument.querySelector('#sign_in_button_$viewId'); + assert(element != null, + 'Cannot render GSI button. DOM is not ready!'); + _gisClient.renderButton(element!, config); }); } return const Text('Getting ready'); @@ -215,11 +219,10 @@ class GoogleSignInPlugin extends GoogleSignInPlatform { @override Future signIn() async { if (kDebugMode) { - web.console.warn( + domConsole.warn( "The `signIn` method is discouraged on the web because it can't reliably provide an `idToken`.\n" - 'Use `signInSilently` and `renderButton` to authenticate your users instead.\n' - 'Read more: https://pub.dev/packages/google_sign_in_web' - .toJS); + 'Use `signInSilently` and `renderButton` to authenticate your users instead.\n' + 'Read more: https://pub.dev/packages/google_sign_in_web'); } await initialized; @@ -297,11 +300,4 @@ class GoogleSignInPlugin extends GoogleSignInPlatform { @override Stream? get userDataEvents => _userDataController.stream; - - /// Requests server auth code from GIS Client per: - /// https://developers.google.com/identity/oauth2/web/guides/use-code-model#initialize_a_code_client - Future requestServerAuthCode() async { - await initialized; - return _gisClient.requestServerAuthCode(); - } } diff --git a/packages/google_sign_in/google_sign_in_web/lib/src/button_configuration.dart b/packages/google_sign_in/google_sign_in_web/lib/src/button_configuration.dart index 7869348dfe9f..24d13d5ae488 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/src/button_configuration.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/src/button_configuration.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'package:google_identity_services_web/id.dart' as id; +import 'package:js/js_util.dart' as js_util; /// Converts user-facing `GisButtonConfiguration` into the JS-Interop `id.GsiButtonConfiguration`. id.GsiButtonConfiguration? convertButtonConfiguration( @@ -11,16 +12,17 @@ id.GsiButtonConfiguration? convertButtonConfiguration( if (config == null) { return null; } - return id.GsiButtonConfiguration( - type: _idType[config.type], - theme: _idTheme[config.theme], - size: _idSize[config.size], - text: _idText[config.text], - shape: _idShape[config.shape], - logo_alignment: _idLogoAlignment[config.logoAlignment], - width: config.minimumWidth, - locale: config.locale, - ); + return js_util.jsify({ + if (config.type != null) 'type': _idType[config.type], + if (config.theme != null) 'theme': _idTheme[config.theme], + if (config.size != null) 'size': _idSize[config.size], + if (config.text != null) 'text': _idText[config.text], + if (config.shape != null) 'shape': _idShape[config.shape], + if (config.logoAlignment != null) + 'logo_alignment': _idLogoAlignment[config.logoAlignment], + if (config.minimumWidth != null) 'width': config.minimumWidth, + if (config.locale != null) 'locale': config.locale, + }) as id.GsiButtonConfiguration; } /// A class to configure the Google Sign-In Button for web. diff --git a/packages/google_sign_in/google_sign_in_web/lib/src/dom.dart b/packages/google_sign_in/google_sign_in_web/lib/src/dom.dart new file mode 100644 index 000000000000..a4d5b6799f7d --- /dev/null +++ b/packages/google_sign_in/google_sign_in_web/lib/src/dom.dart @@ -0,0 +1,211 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// ignore_for_file: public_member_api_docs + +import 'package:js/js.dart'; +import 'package:js/js_util.dart' as js_util; + +@JS() +@staticInterop +class DomConsole {} + +extension DomConsoleExtension on DomConsole { + void debug(String message, [List? more]) => + js_util.callMethod(this, 'debug', [message, ...?more]); + void info(String message, [List? more]) => + js_util.callMethod(this, 'info', [message, ...?more]); + void warn(String message, [List? more]) => + js_util.callMethod(this, 'warn', [message, ...?more]); +} + +@JS() +@staticInterop +class DomWindow {} + +@JS() +@staticInterop +class DomDocument {} + +extension DomDocumentExtension on DomDocument { + external DomElement? querySelector(String selectors); + DomElement createElement(String name, [Object? options]) => + js_util.callMethod(this, 'createElement', + [name, if (options != null) options]) as DomElement; +} + +@JS() +@staticInterop +class DomElement {} + +extension DomElementExtension on DomElement { + external String get id; + external set id(String id); + external String? getAttribute(String attributeName); + external void remove(); + external void setAttribute(String name, Object value); + external void removeAttribute(String name); + external set tabIndex(double? value); + external double? get tabIndex; + external set className(String value); + external String get className; + external bool hasAttribute(String name); + external DomElement? get firstChild; + external DomElement? querySelector(String selectors); + external String get tagName; +} + +@JS('window') +external DomWindow get domWindow; + +@JS('document') +external DomDocument get domDocument; + +@JS('console') +external DomConsole get domConsole; + +DomElement createDomElement(String tag) => domDocument.createElement(tag); + +/// DOM Observers: Mutation and Size +typedef DomMutationCallbackFn = void Function( + List mutation, DomMutationObserver observer); + +@JS() +@staticInterop +class DomMutationObserver {} + +DomMutationObserver createDomMutationObserver(DomMutationCallbackFn fn) => + domCallConstructorString('MutationObserver', [ + allowInterop( + (List mutations, DomMutationObserver observer) { + fn(mutations.cast(), observer); + }, + ) + ])! as DomMutationObserver; + +extension DomMutationObserverExtension on DomMutationObserver { + external void disconnect(); + void observe(DomElement target, + {bool? childList, + bool? attributes, + bool? subtree, + List? attributeFilter}) { + final Map options = { + if (childList != null) 'childList': childList, + if (attributes != null) 'attributes': attributes, + if (subtree != null) 'subtree': subtree, + if (attributeFilter != null) 'attributeFilter': attributeFilter + }; + return js_util + .callMethod(this, 'observe', [target, js_util.jsify(options)]); + } +} + +@JS() +@staticInterop +class DomMutationRecord {} + +extension DomMutationRecordExtension on DomMutationRecord { + external List? get addedNodes; + external List? get removedNodes; + external String? get attributeName; + external String? get type; +} + +/// ResizeObserver JS binding. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver +@JS() +@staticInterop +abstract class DomResizeObserver {} + +/// Creates a DomResizeObserver with a callback. +/// +/// Internally converts the `List` of entries into the expected +/// `List` +DomResizeObserver? createDomResizeObserver(DomResizeObserverCallbackFn fn) { + return domCallConstructorString('ResizeObserver', [ + allowInterop((List entries, DomResizeObserver observer) { + fn(entries.cast(), observer); + }), + ]) as DomResizeObserver?; +} + +/// ResizeObserver instance methods. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#instance_methods +extension DomResizeObserverExtension on DomResizeObserver { + external void disconnect(); + external void observe(DomElement target, + [DomResizeObserverObserveOptions options]); + external void unobserve(DomElement target); +} + +/// Options object passed to the `observe` method of a [DomResizeObserver]. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver/observe#parameters +@JS() +@staticInterop +@anonymous +abstract class DomResizeObserverObserveOptions { + external factory DomResizeObserverObserveOptions({ + String box, + }); +} + +/// Type of the function used to create a Resize Observer. +typedef DomResizeObserverCallbackFn = void Function( + List entries, DomResizeObserver observer); + +/// The object passed to the [DomResizeObserverCallbackFn], which allows access to the new dimensions of the observed element. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry +@JS() +@staticInterop +abstract class DomResizeObserverEntry {} + +/// ResizeObserverEntry instance properties. +/// +/// See: https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserverEntry#instance_properties +extension DomResizeObserverEntryExtension on DomResizeObserverEntry { + /// A DOMRectReadOnly object containing the new size of the observed element when the callback is run. + /// + /// Note that this is better supported than the above two properties, but it + /// is left over from an earlier implementation of the Resize Observer API, is + /// still included in the spec for web compat reasons, and may be deprecated + /// in future versions. + external DomRectReadOnly get contentRect; + external DomElement get target; + // Some more future getters: + // + // borderBoxSize + // contentBoxSize + // devicePixelContentBoxSize +} + +@JS() +@staticInterop +class DomRectReadOnly {} + +extension DomRectReadOnlyExtension on DomRectReadOnly { + external double get x; + external double get y; + external double get width; + external double get height; + external double get top; + external double get right; + external double get bottom; + external double get left; +} + +Object? domGetConstructor(String constructorName) => + js_util.getProperty(domWindow, constructorName); + +T? domCallConstructorString(String constructorName, List args) { + final Object? constructor = domGetConstructor(constructorName); + if (constructor == null) { + return null; + } + return js_util.callConstructor(constructor, args); +} diff --git a/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart b/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart index 63acfb84836e..fb639faccd80 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/src/flexible_size_html_element_view.dart @@ -1,12 +1,11 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_interop'; -import 'dart:ui_web' as ui_web; -import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; -import 'package:web/web.dart' as web; +import 'package:flutter/services.dart'; + +import 'dom.dart'; /// An HTMLElementView widget that resizes with its contents. class FlexHtmlElementView extends StatefulWidget { @@ -14,15 +13,15 @@ class FlexHtmlElementView extends StatefulWidget { const FlexHtmlElementView({ super.key, required this.viewType, - this.onElementCreated, + this.onPlatformViewCreated, this.initialSize, }); /// See [HtmlElementView.viewType]. final String viewType; - /// See [HtmlElementView.fromTagName] `onElementCreated`. - final ElementCreatedCallback? onElementCreated; + /// See [HtmlElementView.onPlatformViewCreated]. + final PlatformViewCreatedCallback? onPlatformViewCreated; /// The initial Size for the widget, before it starts tracking its contents. final Size? initialSize; @@ -38,12 +37,12 @@ class _FlexHtmlElementView extends State { /// Watches for changes being made to the DOM tree. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver - web.MutationObserver? _mutationObserver; + DomMutationObserver? _mutationObserver; /// Reports changes to the dimensions of an Element's content box. /// /// See: https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API - web.ResizeObserver? _resizeObserver; + DomResizeObserver? _resizeObserver; @override void dispose() { @@ -56,15 +55,8 @@ class _FlexHtmlElementView extends State { /// Update the state with the new `size`, if needed. void _doResize(Size size) { if (size != _lastReportedSize) { - if (kDebugMode) { - final String log = [ - 'Resizing: ', - widget.viewType, - size.width, - size.height - ].join(' '); - web.console.debug(log.toJS); - } + domConsole.debug( + 'Resizing', [widget.viewType, size.width, size.height]); setState(() { _lastReportedSize = size; }); @@ -73,15 +65,12 @@ class _FlexHtmlElementView extends State { /// The function called whenever an observed resize occurs. void _onResizeEntries( - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray resizes, - web.ResizeObserver observer, + List resizes, + DomResizeObserver observer, ) { - final web.DOMRectReadOnly rect = - resizes.toDart.cast().last.contentRect; + final DomRectReadOnly rect = resizes.last.contentRect; if (rect.width > 0 && rect.height > 0) { - _doResize(Size(rect.width.toDouble(), rect.height.toDouble())); + _doResize(Size(rect.width, rect.height)); } } @@ -90,36 +79,31 @@ class _FlexHtmlElementView extends State { /// When mutations are received, this function attaches a Resize Observer to /// the first child of the mutation, which will drive void _onMutationRecords( - // TODO(srujzs): Remove once typed JSArrays (JSArray) get to `stable`. - // ignore: always_specify_types - JSArray mutations, - web.MutationObserver observer, + List mutations, + DomMutationObserver observer, ) { - mutations.toDart - .cast() - .forEach((web.MutationRecord mutation) { - if (mutation.addedNodes.length > 0) { - final web.Element? element = _locateSizeProvider(mutation.addedNodes); + for (final DomMutationRecord mutation in mutations) { + if (mutation.addedNodes != null) { + final DomElement? element = _locateSizeProvider(mutation.addedNodes!); if (element != null) { - _resizeObserver = web.ResizeObserver(_onResizeEntries.toJS); + _resizeObserver = createDomResizeObserver(_onResizeEntries); _resizeObserver?.observe(element); // Stop looking at other mutations observer.disconnect(); return; } } - }); + } } /// Registers a MutationObserver on the root element of the HtmlElementView. - void _registerListeners(web.Element root) { - _mutationObserver = web.MutationObserver(_onMutationRecords.toJS); + void _registerListeners(DomElement? root) { + assert(root != null, 'DOM is not ready for the FlexHtmlElementView'); + _mutationObserver = createDomMutationObserver(_onMutationRecords); // Monitor the size of the child element, whenever it's created... _mutationObserver!.observe( - root, - web.MutationObserverInit( - childList: true, - ), + root!, + childList: true, ); } @@ -129,13 +113,10 @@ class _FlexHtmlElementView extends State { size: _lastReportedSize ?? widget.initialSize ?? const Size(1, 1), child: HtmlElementView( viewType: widget.viewType, - onPlatformViewCreated: (int viewId) { - final ElementCreatedCallback? callback = widget.onElementCreated; - final web.Element root = - ui_web.platformViewRegistry.getViewById(viewId) as web.Element; - _registerListeners(root); - if (callback != null) { - callback(root); + onPlatformViewCreated: (int viewId) async { + _registerListeners(_locatePlatformViewRoot(viewId)); + if (widget.onPlatformViewCreated != null) { + widget.onPlatformViewCreated!(viewId); } }), ); @@ -146,6 +127,14 @@ class _FlexHtmlElementView extends State { /// /// The `elements` list should contain a single element: the only child of the /// element returned by `_locatePlatformViewRoot`. -web.Element? _locateSizeProvider(web.NodeList elements) { - return elements.item(0) as web.Element?; +DomElement? _locateSizeProvider(List elements) { + return elements.first; +} + +/// Finds the root element of a platform view by its `viewId`. +/// +/// This element matches the one returned by the registered platform view factory. +DomElement? _locatePlatformViewRoot(int viewId) { + return domDocument + .querySelector('flt-platform-view[slot\$="-$viewId"] :first-child'); } diff --git a/packages/google_sign_in/google_sign_in_web/lib/src/gis_client.dart b/packages/google_sign_in/google_sign_in_web/lib/src/gis_client.dart index b28796b8d68f..cf79de8a3a20 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/src/gis_client.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/src/gis_client.dart @@ -2,16 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import 'dart:async'; -import 'dart:js_interop'; // TODO(dit): Split `id` and `oauth2` "services" for mocking. https://github.com/flutter/flutter/issues/120657 import 'package:google_identity_services_web/id.dart'; import 'package:google_identity_services_web/oauth2.dart'; import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart'; -import 'package:web/web.dart' as web; +// ignore: unnecessary_import +import 'package:js/js.dart'; +import 'package:js/js_util.dart'; import 'button_configuration.dart' show GSIButtonConfiguration, convertButtonConfiguration; +import 'dom.dart'; import 'people.dart' as people; import 'utils.dart' as utils; @@ -49,23 +51,11 @@ class GisSdkClient { onResponse: _onTokenResponse, onError: _onTokenError, ); - - if (initialScopes.isNotEmpty) { - _codeClient = _initializeCodeClient( - clientId, - hostedDomain: hostedDomain, - onResponse: _onCodeResponse, - onError: _onCodeError, - scopes: initialScopes, - ); - } } void _logIfEnabled(String message, [List? more]) { if (_loggingEnabled) { - final String log = - ['[google_sign_in_web]', message, ...?more].join(' '); - web.console.info(log.toJS); + domConsole.info('[google_sign_in_web] $message', more); } } @@ -73,24 +63,16 @@ class GisSdkClient { void _configureStreams() { _tokenResponses = StreamController.broadcast(); _credentialResponses = StreamController.broadcast(); - _codeResponses = StreamController.broadcast(); _tokenResponses.stream.listen((TokenResponse response) { _lastTokenResponse = response; _lastTokenResponseExpiration = - DateTime.now().add(Duration(seconds: response.expires_in!)); + DateTime.now().add(Duration(seconds: response.expires_in)); }, onError: (Object error) { _logIfEnabled('Error on TokenResponse:', [error.toString()]); _lastTokenResponse = null; }); - _codeResponses.stream.listen((CodeResponse response) { - _lastCodeResponse = response; - }, onError: (Object error) { - _logIfEnabled('Error on CodeResponse:', [error.toString()]); - _lastCodeResponse = null; - }); - _credentialResponses.stream.listen((CredentialResponse response) { _lastCredentialResponse = response; }, onError: (Object error) { @@ -130,7 +112,7 @@ class GisSdkClient { // Initialize `id` for the silent-sign in code. final IdConfiguration idConfig = IdConfiguration( client_id: clientId, - callback: onResponse, + callback: allowInterop(onResponse), cancel_on_tap_outside: false, auto_select: true, // Attempt to sign-in silently. hd: hostedDomain, @@ -161,14 +143,12 @@ class GisSdkClient { // Create a Token Client for authorization calls. final TokenClientConfig tokenConfig = TokenClientConfig( client_id: clientId, - hd: hostedDomain, - callback: _onTokenResponse, - error_callback: _onTokenError, - // This is here only to satisfy the initialization of the JS TokenClient. - // In reality, `scope` is always overridden when calling `requestScopes` - // (or the deprecated `signIn`) through an [OverridableTokenClientConfig] - // object. - scope: [' '], // Fake (but non-empty) list of scopes. + hosted_domain: hostedDomain, + callback: allowInterop(_onTokenResponse), + error_callback: allowInterop(_onTokenError), + // `scope` will be modified by the `signIn` method, in case we need to + // backfill user Profile info. + scope: ' ', ); return oauth2.initTokenClient(tokenConfig); } @@ -189,44 +169,9 @@ class GisSdkClient { // Token clients have an additional `error_callback` for miscellaneous // errors, like "popup couldn't open" or "popup closed by user". void _onTokenError(Object? error) { - if (error != null) { - _tokenResponses.addError((error as GoogleIdentityServicesError).type); - } - } - -// Creates a `oauth2.CodeClient` used for authorization (scope) requests. - CodeClient _initializeCodeClient( - String clientId, { - String? hostedDomain, - required List scopes, - required CodeClientCallbackFn onResponse, - required ErrorCallbackFn onError, - }) { - // Create a Token Client for authorization calls. - final CodeClientConfig codeConfig = CodeClientConfig( - client_id: clientId, - hd: hostedDomain, - callback: _onCodeResponse, - error_callback: _onCodeError, - scope: scopes, - select_account: true, - ux_mode: UxMode.popup, - ); - return oauth2.initCodeClient(codeConfig); - } - - void _onCodeResponse(CodeResponse response) { - if (response.error != null) { - _codeResponses.addError(response.error!); - } else { - _codeResponses.add(response); - } - } - - void _onCodeError(Object? error) { - if (error != null) { - _codeResponses.addError((error as GoogleIdentityServicesError).type); - } + // This is handled in a funky (js_interop) way because of: + // https://github.com/dart-lang/sdk/issues/50899 + _tokenResponses.addError(getProperty(error!, 'type')); } /// Attempts to sign-in the user using the OneTap UX flow. @@ -242,9 +187,9 @@ class GisSdkClient { // Ask the SDK to render the OneClick sign-in. // // And also handle its "moments". - id.prompt((PromptMomentNotification moment) { + id.prompt(allowInterop((PromptMomentNotification moment) { _onPromptMoment(moment, userDataCompleter); - }); + })); return userDataCompleter.future; } @@ -291,21 +236,7 @@ class GisSdkClient { Object parent, GSIButtonConfiguration options, ) async { - return id.renderButton(parent, convertButtonConfiguration(options)); - } - - /// Requests a server auth code per: - /// https://developers.google.com/identity/oauth2/web/guides/use-code-model#initialize_a_code_client - Future requestServerAuthCode() async { - // TODO(dit): Enable granular authorization, https://github.com/flutter/flutter/issues/139406 - assert(_codeClient != null, - 'CodeClient not initialized correctly. Ensure the `scopes` list passed to `init()` or `initWithParams()` is not empty!'); - if (_codeClient == null) { - return null; - } - _codeClient!.requestCode(); - final CodeResponse response = await _codeResponses.stream.first; - return response.code; + return id.renderButton(parent, convertButtonConfiguration(options)!); } // TODO(dit): Clean this up. https://github.com/flutter/flutter/issues/137727 @@ -322,10 +253,11 @@ class GisSdkClient { 'Use `renderButton` instead. See: https://pub.dev/packages/google_sign_in_web#migrating-to-v011-and-v012-google-identity-services') Future signIn() async { // Warn users that this method will be removed. - web.console.warn( - 'The google_sign_in plugin `signIn` method is deprecated on the web, and will be removed in Q2 2024. Please use `renderButton` instead. See: ' - 'https://pub.dev/packages/google_sign_in_web#migrating-to-v011-and-v012-google-identity-services' - .toJS); + domConsole.warn( + 'The google_sign_in plugin `signIn` method is deprecated on the web, and will be removed in Q2 2024. Please use `renderButton` instead. See: ', + [ + 'https://pub.dev/packages/google_sign_in_web#migrating-to-v011-and-v012-google-identity-services' + ]); // If we already know the user, use their `email` as a `hint`, so they don't // have to pick their user again in the Authorization popup. final GoogleSignInUserData? knownUser = @@ -334,14 +266,14 @@ class GisSdkClient { // user activation. _tokenClient.requestAccessToken(OverridableTokenClientConfig( prompt: knownUser == null ? 'select_account' : '', - login_hint: knownUser?.email, + hint: knownUser?.email, scope: [ ..._initialScopes, // If the user hasn't gone through the auth process, // the plugin will attempt to `requestUserData` after, // so we need extra scopes to retrieve that info. if (_lastCredentialResponse == null) ...people.scopes, - ], + ].join(' '), )); await _tokenResponses.stream.first; @@ -374,7 +306,6 @@ class GisSdkClient { return utils.gisResponsesToTokenData( _lastCredentialResponse, _lastTokenResponse, - _lastCodeResponse, ); } @@ -387,7 +318,7 @@ class GisSdkClient { /// Revokes the current authorization and authentication. Future disconnect() async { if (_lastTokenResponse != null) { - oauth2.revoke(_lastTokenResponse!.access_token!); + oauth2.revoke(_lastTokenResponse!.access_token); } await signOut(); } @@ -420,7 +351,6 @@ class GisSdkClient { _lastCredentialResponse = null; _lastTokenResponse = null; _requestedUserData = null; - _lastCodeResponse = null; } /// Requests the list of [scopes] passed in to the client. @@ -434,8 +364,8 @@ class GisSdkClient { _tokenClient.requestAccessToken(OverridableTokenClientConfig( prompt: knownUser == null ? 'select_account' : '', - login_hint: knownUser?.email, - scope: scopes, + hint: knownUser?.email, + scope: scopes.join(' '), include_granted_scopes: true, )); @@ -472,20 +402,16 @@ class GisSdkClient { // The Google Identity Services client for oauth requests. late TokenClient _tokenClient; - // CodeClient will not be created if `initialScopes` is empty. - CodeClient? _codeClient; // Streams of credential and token responses. late StreamController _credentialResponses; late StreamController _tokenResponses; - late StreamController _codeResponses; // The last-seen credential and token responses CredentialResponse? _lastCredentialResponse; TokenResponse? _lastTokenResponse; // Expiration timestamp for the lastTokenResponse, which only has an `expires_in` field. DateTime? _lastTokenResponseExpiration; - CodeResponse? _lastCodeResponse; /// The StreamController onto which the GIS Client propagates user authentication events. /// diff --git a/packages/google_sign_in/google_sign_in_web/lib/src/utils.dart b/packages/google_sign_in/google_sign_in_web/lib/src/utils.dart index 05ed6a877d18..609a387d1178 100644 --- a/packages/google_sign_in/google_sign_in_web/lib/src/utils.dart +++ b/packages/google_sign_in/google_sign_in_web/lib/src/utils.dart @@ -99,13 +99,9 @@ DateTime? getCredentialResponseExpirationTimestamp( /// Converts responses from the GIS library into TokenData for the plugin. GoogleSignInTokenData gisResponsesToTokenData( - CredentialResponse? credentialResponse, - TokenResponse? tokenResponse, [ - CodeResponse? codeResponse, -]) { + CredentialResponse? credentialResponse, TokenResponse? tokenResponse) { return GoogleSignInTokenData( idToken: credentialResponse?.credential, accessToken: tokenResponse?.access_token, - serverAuthCode: codeResponse?.code, ); } diff --git a/packages/google_sign_in/google_sign_in_web/lib/web_only.dart b/packages/google_sign_in/google_sign_in_web/lib/web_only.dart deleted file mode 100644 index 34f153d0aef7..000000000000 --- a/packages/google_sign_in/google_sign_in_web/lib/web_only.dart +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/// This library exposes web-only methods of [GoogleSignInPlatform.instance]. -/// -/// The exported methods will assert that the [GoogleSignInPlatform.instance] -/// is an instance of class [GoogleSignInPlugin] (the web implementation of -/// `google_sign_in` provided by this package). -library web_only; - -import 'package:flutter/widgets.dart' show Widget; -import 'package:google_sign_in_platform_interface/google_sign_in_platform_interface.dart' - show GoogleSignInPlatform; - -import 'google_sign_in_web.dart' show GoogleSignInPlugin; -import 'src/button_configuration.dart' show GSIButtonConfiguration; - -// Export the configuration types for the renderButton method. -export 'src/button_configuration.dart' - show - GSIButtonConfiguration, - GSIButtonLogoAlignment, - GSIButtonShape, - GSIButtonSize, - GSIButtonText, - GSIButtonTheme, - GSIButtonType; - -// Asserts that the instance of the platform is for the web. -GoogleSignInPlugin get _plugin { - assert(GoogleSignInPlatform.instance is GoogleSignInPlugin, - 'The current GoogleSignInPlatform instance is not for web.'); - - return GoogleSignInPlatform.instance as GoogleSignInPlugin; -} - -/// Render the GIS Sign-In Button widget with [configuration]. -Widget renderButton({GSIButtonConfiguration? configuration}) { - return _plugin.renderButton(configuration: configuration); -} - -/// Requests server auth code from the GIS Client. -/// -/// See: https://developers.google.com/identity/oauth2/web/guides/use-code-model -Future requestServerAuthCode() async { - return _plugin.requestServerAuthCode(); -} diff --git a/packages/google_sign_in/google_sign_in_web/pubspec.yaml b/packages/google_sign_in/google_sign_in_web/pubspec.yaml index 90697ff63c17..e9836a35cef5 100644 --- a/packages/google_sign_in/google_sign_in_web/pubspec.yaml +++ b/packages/google_sign_in/google_sign_in_web/pubspec.yaml @@ -3,11 +3,11 @@ description: Flutter plugin for Google Sign-In, a secure authentication system for signing in with a Google account on Android, iOS and Web. repository: https://github.com/flutter/packages/tree/main/packages/google_sign_in/google_sign_in_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+google_sign_in%22 -version: 0.12.3+1 +version: 0.12.1 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" flutter: plugin: @@ -22,10 +22,10 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - google_identity_services_web: ^0.3.0 + google_identity_services_web: ^0.2.2 google_sign_in_platform_interface: ^2.4.0 http: ">=0.13.0 <2.0.0" - web: ">=0.3.0 <0.5.0" + js: ^0.6.3 dev_dependencies: flutter_test: diff --git a/packages/image_picker/image_picker/CHANGELOG.md b/packages/image_picker/image_picker/CHANGELOG.md index 03b66b572c83..850bd96394f2 100644 --- a/packages/image_picker/image_picker/CHANGELOG.md +++ b/packages/image_picker/image_picker/CHANGELOG.md @@ -1,6 +1,5 @@ -## 1.0.5 +## NEXT -* Updates example app to use non-deprecated video_player method. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 1.0.4 diff --git a/packages/image_picker/image_picker/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/image_picker/image_picker/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/image_picker/image_picker/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/image_picker/image_picker/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/image_picker/image_picker/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/image_picker/image_picker/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/image_picker/image_picker/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/image_picker/image_picker/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/image_picker/image_picker/example/lib/main.dart b/packages/image_picker/image_picker/example/lib/main.dart index 2e1a3d720e2c..74626cfcea83 100755 --- a/packages/image_picker/image_picker/example/lib/main.dart +++ b/packages/image_picker/image_picker/example/lib/main.dart @@ -62,7 +62,11 @@ class _MyHomePageState extends State { await _disposeVideoController(); late VideoPlayerController controller; if (kIsWeb) { - controller = VideoPlayerController.networkUrl(Uri.parse(file.path)); + // TODO(gabrielokura): remove the ignore once the following line can migrate to + // use VideoPlayerController.networkUrl after the issue is resolved. + // https://github.com/flutter/flutter/issues/121927 + // ignore: deprecated_member_use + controller = VideoPlayerController.network(file.path); } else { controller = VideoPlayerController.file(File(file.path)); } diff --git a/packages/image_picker/image_picker/example/pubspec.yaml b/packages/image_picker/image_picker/example/pubspec.yaml index f38127fe6706..3dd1f8dd8c97 100644 --- a/packages/image_picker/image_picker/example/pubspec.yaml +++ b/packages/image_picker/image_picker/example/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: path: ../ image_picker_platform_interface: ^2.8.0 mime: ^1.0.4 - video_player: ^2.7.0 + video_player: ^2.1.4 dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/image_picker/image_picker/pubspec.yaml b/packages/image_picker/image_picker/pubspec.yaml index 7fde8ca7bb64..4c6004d18024 100755 --- a/packages/image_picker/image_picker/pubspec.yaml +++ b/packages/image_picker/image_picker/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for selecting images from the Android and iOS image library, and taking new pictures with the camera. repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 1.0.5 +version: 1.0.4 environment: sdk: ">=3.0.0 <4.0.0" @@ -41,7 +41,7 @@ dev_dependencies: cross_file: ^0.3.1+1 # Mockito generates a direct include. flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 plugin_platform_interface: ^2.0.0 topics: diff --git a/packages/image_picker/image_picker/test/image_picker_test.mocks.dart b/packages/image_picker/image_picker/test/image_picker_test.mocks.dart index 30d4b541cb61..85c9df08c790 100644 --- a/packages/image_picker/image_picker/test/image_picker_test.mocks.dart +++ b/packages/image_picker/image_picker/test/image_picker_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in image_picker/test/image_picker_test.dart. // Do not manually edit this file. @@ -15,8 +15,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -76,7 +74,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future<_i2.PickedFile?>.value(), ) as _i4.Future<_i2.PickedFile?>); - @override _i4.Future?> pickMultiImage({ double? maxWidth, @@ -95,7 +92,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future?>.value(), ) as _i4.Future?>); - @override _i4.Future<_i2.PickedFile?> pickVideo({ required _i2.ImageSource? source, @@ -114,7 +110,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future<_i2.PickedFile?>.value(), ) as _i4.Future<_i2.PickedFile?>); - @override _i4.Future<_i2.LostData> retrieveLostData() => (super.noSuchMethod( Invocation.method( @@ -129,7 +124,6 @@ class MockImagePickerPlatform extends _i1.Mock ), )), ) as _i4.Future<_i2.LostData>); - @override _i4.Future<_i5.XFile?> getImage({ required _i2.ImageSource? source, @@ -152,7 +146,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future<_i5.XFile?>.value(), ) as _i4.Future<_i5.XFile?>); - @override _i4.Future?> getMultiImage({ double? maxWidth, @@ -171,7 +164,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future?>.value(), ) as _i4.Future?>); - @override _i4.Future> getMedia({required _i2.MediaOptions? options}) => (super.noSuchMethod( @@ -182,7 +174,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future>.value(<_i5.XFile>[]), ) as _i4.Future>); - @override _i4.Future<_i5.XFile?> getVideo({ required _i2.ImageSource? source, @@ -201,7 +192,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future<_i5.XFile?>.value(), ) as _i4.Future<_i5.XFile?>); - @override _i4.Future<_i2.LostDataResponse> getLostData() => (super.noSuchMethod( Invocation.method( @@ -217,7 +207,6 @@ class MockImagePickerPlatform extends _i1.Mock ), )), ) as _i4.Future<_i2.LostDataResponse>); - @override _i4.Future<_i5.XFile?> getImageFromSource({ required _i2.ImageSource? source, @@ -234,7 +223,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future<_i5.XFile?>.value(), ) as _i4.Future<_i5.XFile?>); - @override _i4.Future> getMultiImageWithOptions( {_i2.MultiImagePickerOptions? options = @@ -247,7 +235,6 @@ class MockImagePickerPlatform extends _i1.Mock ), returnValue: _i4.Future>.value(<_i5.XFile>[]), ) as _i4.Future>); - @override bool supportsImageSource(_i2.ImageSource? source) => (super.noSuchMethod( Invocation.method( diff --git a/packages/image_picker/image_picker_android/CHANGELOG.md b/packages/image_picker/image_picker_android/CHANGELOG.md index 66a8a8537515..6fe443773953 100644 --- a/packages/image_picker/image_picker_android/CHANGELOG.md +++ b/packages/image_picker/image_picker_android/CHANGELOG.md @@ -1,10 +1,5 @@ -## 0.8.9+1 +## NEXT -* Updates plugin and example Gradle versions to 7.6.3. - -## 0.8.9 - -* Fixes resizing bug and updates rounding to be more accurate. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 0.8.8+2 diff --git a/packages/image_picker/image_picker_android/android/gradle/wrapper/gradle-wrapper.properties b/packages/image_picker/image_picker_android/android/gradle/wrapper/gradle-wrapper.properties index 068cdb2dc260..774fae87671b 100644 --- a/packages/image_picker/image_picker_android/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/image_picker/image_picker_android/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImageResizer.java b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImageResizer.java index 3d4422ac3204..b5024d6780c3 100644 --- a/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImageResizer.java +++ b/packages/image_picker/image_picker_android/android/src/main/java/io/flutter/plugins/imagepicker/ImageResizer.java @@ -10,7 +10,6 @@ import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; -import androidx.annotation.VisibleForTesting; import androidx.core.util.SizeFCompat; import androidx.exifinterface.media.ExifInterface; import java.io.ByteArrayOutputStream; @@ -83,34 +82,47 @@ private File resizedImage( } private SizeFCompat calculateTargetSize( - double originalWidth, - double originalHeight, + @NonNull Double originalWidth, + @NonNull Double originalHeight, @Nullable Double maxWidth, @Nullable Double maxHeight) { - double aspectRatio = originalWidth / originalHeight; boolean hasMaxWidth = maxWidth != null; boolean hasMaxHeight = maxHeight != null; - double width = hasMaxWidth ? Math.min(originalWidth, Math.round(maxWidth)) : originalWidth; - double height = hasMaxHeight ? Math.min(originalHeight, Math.round(maxHeight)) : originalHeight; + Double width = hasMaxWidth ? Math.min(originalWidth, maxWidth) : originalWidth; + Double height = hasMaxHeight ? Math.min(originalHeight, maxHeight) : originalHeight; boolean shouldDownscaleWidth = hasMaxWidth && maxWidth < originalWidth; boolean shouldDownscaleHeight = hasMaxHeight && maxHeight < originalHeight; boolean shouldDownscale = shouldDownscaleWidth || shouldDownscaleHeight; if (shouldDownscale) { - double WidthForMaxHeight = height * aspectRatio; - double heightForMaxWidth = width / aspectRatio; - - if (heightForMaxWidth > height) { - width = (double) Math.round(WidthForMaxHeight); + double downscaledWidth = (height / originalHeight) * originalWidth; + double downscaledHeight = (width / originalWidth) * originalHeight; + + if (width < height) { + if (!hasMaxWidth) { + width = downscaledWidth; + } else { + height = downscaledHeight; + } + } else if (height < width) { + if (!hasMaxHeight) { + height = downscaledHeight; + } else { + width = downscaledWidth; + } } else { - height = (double) Math.round(heightForMaxWidth); + if (originalWidth < originalHeight) { + width = downscaledWidth; + } else if (originalHeight < originalWidth) { + height = downscaledHeight; + } } } - return new SizeFCompat((float) width, (float) height); + return new SizeFCompat(width.floatValue(), height.floatValue()); } private File createFile(File externalFilesDirectory, String child) { @@ -133,8 +145,7 @@ private void copyExif(String filePathOri, String filePathDest) { } } - @VisibleForTesting - SizeFCompat readFileDimensions(String path) { + private SizeFCompat readFileDimensions(String path) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; decodeFile(path, options); diff --git a/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/ImageResizerTest.java b/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/ImageResizerTest.java index 7320e324c4ca..d54471786ca7 100644 --- a/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/ImageResizerTest.java +++ b/packages/image_picker/image_picker_android/android/src/test/java/io/flutter/plugins/imagepicker/ImageResizerTest.java @@ -18,7 +18,6 @@ import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; -import androidx.core.util.SizeFCompat; import java.io.File; import java.io.IOException; import java.util.List; @@ -41,8 +40,6 @@ public class ImageResizerTest { Context mockContext; File imageFile; File svgImageFile; - File tallJPG; - File wideJPG; File externalDirectory; Bitmap originalImageBitmap; @@ -53,10 +50,6 @@ public void setUp() throws IOException { mockCloseable = MockitoAnnotations.openMocks(this); imageFile = new File(getClass().getClassLoader().getResource("pngImage.png").getFile()); svgImageFile = new File(getClass().getClassLoader().getResource("flutter_image.svg").getFile()); - // tallJPG has height 7px and width 4px. - tallJPG = new File(getClass().getClassLoader().getResource("jpgImageTall.jpg").getFile()); - // wideJPG has height 7px and width 12px. - wideJPG = new File(getClass().getClassLoader().getResource("jpgImageWide.jpg").getFile()); originalImageBitmap = BitmapFactory.decodeFile(imageFile.getPath()); TemporaryFolder temporaryFolder = new TemporaryFolder(); temporaryFolder.create(); @@ -141,82 +134,4 @@ public void onResizeImageIfNeeded_whenResizeIsNecessary_shouldDecodeBitmapPixels assertFalse(capturedOptions.get(1).inJustDecodeBounds); } } - - @Test - public void - onResizeImageIfNeeded_whenImageIsVertical_WidthIsGreaterThanOriginal_shouldResizeCorrectly() { - String outputFile = resizer.resizeImageIfNeeded(tallJPG.getPath(), 5.0, 5.0, 100); - SizeFCompat originalSize = - resizer.readFileDimensions(externalDirectory.getPath() + "/scaled_jpgImageTall.jpg"); - - float width = originalSize.getWidth(); - float height = originalSize.getHeight(); - assertThat(width, equalTo(3.0F)); - assertThat(height, equalTo(5.0F)); - } - - @Test - public void - onResizeImageIfNeeded_whenImageIsVertical_HeightIsGreaterThanOriginal_shouldResizeCorrectly() { - String outputFile = resizer.resizeImageIfNeeded(tallJPG.getPath(), 3.0, 10.0, 100); - SizeFCompat originalSize = - resizer.readFileDimensions(externalDirectory.getPath() + "/scaled_jpgImageTall.jpg"); - - float width = originalSize.getWidth(); - float height = originalSize.getHeight(); - assertThat(width, equalTo(3.0F)); - assertThat(height, equalTo(5.0F)); - } - - @Test - public void - onResizeImageIfNeeded_whenImageIsVertical_HeightAndWidthIsGreaterThanOriginal_shouldNotResize() { - String outputFile = resizer.resizeImageIfNeeded(tallJPG.getPath(), 10.0, 10.0, 100); - SizeFCompat originalSize = - resizer.readFileDimensions(externalDirectory.getPath() + "/scaled_jpgImageTall.jpg"); - - float width = originalSize.getWidth(); - float height = originalSize.getHeight(); - assertThat(width, equalTo(4.0F)); - assertThat(height, equalTo(7.0F)); - } - - @Test - public void - onResizeImageIfNeeded_whenImageIsHorizontal_WidthIsGreaterThanOriginal_shouldResizeCorrectly() { - String outputFile = resizer.resizeImageIfNeeded(wideJPG.getPath(), 10.0, 20.0, 100); - SizeFCompat originalSize = - resizer.readFileDimensions(externalDirectory.getPath() + "/scaled_jpgImageWide.jpg"); - - float width = originalSize.getWidth(); - float height = originalSize.getHeight(); - assertThat(width, equalTo(10.0F)); - assertThat(height, equalTo(6.0F)); - } - - @Test - public void - onResizeImageIfNeeded_whenImageIsHorizontal_HeightIsGreaterThanOriginal_shouldResizeCorrectly() { - String outputFile = resizer.resizeImageIfNeeded(wideJPG.getPath(), 10.0, 10.0, 100); - SizeFCompat originalSize = - resizer.readFileDimensions(externalDirectory.getPath() + "/scaled_jpgImageWide.jpg"); - - float width = originalSize.getWidth(); - float height = originalSize.getHeight(); - assertThat(width, equalTo(10.0F)); - assertThat(height, equalTo(6.0F)); - } - - @Test - public void - onResizeImageIfNeeded_whenImageIsHorizontal_HeightAndWidthIsGreaterThanOriginal_shouldNotResize() { - String outputFile = resizer.resizeImageIfNeeded(wideJPG.getPath(), 100.0, 100.0, 100); - SizeFCompat originalSize = - resizer.readFileDimensions(externalDirectory.getPath() + "/scaled_jpgImageWide.jpg"); - - float width = originalSize.getWidth(); - float height = originalSize.getHeight(); - assertThat(width, equalTo(12.0F)); - assertThat(height, equalTo(7.0F)); - } } diff --git a/packages/image_picker/image_picker_android/android/src/test/resources/jpgImageTall.jpg b/packages/image_picker/image_picker_android/android/src/test/resources/jpgImageTall.jpg deleted file mode 100644 index d7c137eb5ae1..000000000000 Binary files a/packages/image_picker/image_picker_android/android/src/test/resources/jpgImageTall.jpg and /dev/null differ diff --git a/packages/image_picker/image_picker_android/android/src/test/resources/jpgImageWide.jpg b/packages/image_picker/image_picker_android/android/src/test/resources/jpgImageWide.jpg deleted file mode 100644 index 12b2dc17624c..000000000000 Binary files a/packages/image_picker/image_picker_android/android/src/test/resources/jpgImageWide.jpg and /dev/null differ diff --git a/packages/image_picker/image_picker_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/image_picker/image_picker_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/image_picker/image_picker_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/image_picker/image_picker_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/image_picker/image_picker_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/image_picker/image_picker_android/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/image_picker/image_picker_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/image_picker/image_picker_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/image_picker/image_picker_android/pubspec.yaml b/packages/image_picker/image_picker_android/pubspec.yaml index 03a46ad1b873..3581f558c495 100755 --- a/packages/image_picker/image_picker_android/pubspec.yaml +++ b/packages/image_picker/image_picker_android/pubspec.yaml @@ -2,7 +2,8 @@ name: image_picker_android description: Android implementation of the image_picker plugin. repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 0.8.9+1 + +version: 0.8.8+2 environment: sdk: ">=3.0.0 <4.0.0" @@ -26,7 +27,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^9.2.5 topics: diff --git a/packages/image_picker/image_picker_ios/CHANGELOG.md b/packages/image_picker/image_picker_ios/CHANGELOG.md index d3855a4d2b75..fe29ad80ad01 100644 --- a/packages/image_picker/image_picker_ios/CHANGELOG.md +++ b/packages/image_picker/image_picker_ios/CHANGELOG.md @@ -1,6 +1,5 @@ -## 0.8.9 +## NEXT -* Fixes resizing bug and updates rounding to be more accurate. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 0.8.8+4 diff --git a/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerTestImages.h b/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerTestImages.h index c6cfa6c788d2..1074a5c62455 100644 --- a/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerTestImages.h +++ b/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerTestImages.h @@ -9,7 +9,6 @@ NS_ASSUME_NONNULL_BEGIN @interface ImagePickerTestImages : NSObject @property(class, copy, readonly) NSData *JPGTestData; -@property(class, copy, readonly) NSData *JPGTallTestData; @property(class, copy, readonly) NSData *PNGTestData; @property(class, copy, readonly) NSData *GIFTestData; diff --git a/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerTestImages.m b/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerTestImages.m index b91eec293028..64843f75d05b 100644 --- a/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerTestImages.m +++ b/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImagePickerTestImages.m @@ -73,78 +73,6 @@ + (NSData *)JPGTestData { return data; } -+ (NSData *)JPGTallTestData { - NSBundle *bundle = [NSBundle bundleForClass:self]; - NSURL *url = [bundle URLForResource:@"jpgImageTall" withExtension:@"jpg"]; - NSData *data = [NSData dataWithContentsOfURL:url]; - if (!data.length) { - // When the tests are run outside the example project (podspec lint) the image may not be - // embedded in the test bundle. Fall back to the base64 string representation of the jpg. - data = [[NSData alloc] - initWithBase64EncodedString: - @"/9j/4AAQSkZJRgABAQAALgAuAAD/" - @"4QCMRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABA" - @"AIAAIdpAAQAAAABAAAAWgAAAAAAAAAuAAAAAQAAAC4AAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAASgAw" - @"AEAAAAAQAAAAcAAAAA/" - @"+EJ12h0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTX" - @"BDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB" - @"0az0iWE1QIENvcmUgNi4wLjAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkv" - @"MDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczpwaG90b" - @"3Nob3A9Imh0dHA6Ly9ucy5hZG9iZS5jb20vcGhvdG9zaG9wLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC" - @"5vcmcvZGMvZWxlbWVudHMvMS4xLyIgcGhvdG9zaG9wOkNyZWRpdD0iwqkgR29vZ2xlIj4gPGRjOnN1YmplY3Q" - @"+IDxyZGY6QmFnLz4gPC9kYzpzdWJqZWN0PiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1w" - @"bWV0YT4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI" - @"CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC" - @"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA" - @"gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg" - @"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI" - @"CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC" - @"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA" - @"gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg" - @"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI" - @"CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC" - @"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA" - @"gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg" - @"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI" - @"CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC" - @"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA" - @"gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg" - @"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI" - @"CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC" - @"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA" - @"gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg" - @"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI" - @"CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC" - @"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA" - @"gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg" - @"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI" - @"CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC" - @"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA" - @"gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg" - @"ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI" - @"CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC" - @"AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA" - @"gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg" - @"ICAgICAgICAgICAgICA8P3hwYWNrZXQgZW5kPSJ3Ij8+AP/" - @"tAFZQaG90b3Nob3AgMy4wADhCSU0EBAAAAAAAHRwBWgADGyVHHAIAAAIAAhwCbgAJwqkgR29vZ2xlADhCSU0E" - @"JQAAAAAAEJpLdiBdz4DSVTBp1ds4oxH/wAARCAAHAAQDASIAAhEBAxEB/" - @"8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/" - @"8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGR" - @"olJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqK" - @"jpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/" - @"8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/" - @"8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8R" - @"cYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJm" - @"aoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/" - @"9sAQwAEAwMDAwIEAwMDBAQEBQYKBgYFBQYMCAkHCg4MDw4ODA0NDxEWEw8QFRENDRMaExUXGBkZGQ8SGx0bGB" - @"0WGBkY/" - @"9sAQwEEBAQGBQYLBgYLGBANEBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGB" - @"gYGBgY/90ABAAB/9oADAMBAAIRAxEAPwDFooor85P6qP/Z" - options:0]; - } - return data; -} - + (NSData *)PNGTestData { NSBundle *bundle = [NSBundle bundleForClass:self]; NSURL *url = [bundle URLForResource:@"pngImage" withExtension:@"png"]; diff --git a/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImageUtilTests.m b/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImageUtilTests.m index ddd4087a9f4b..1dc807a15dba 100644 --- a/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImageUtilTests.m +++ b/packages/image_picker/image_picker_ios/example/ios/RunnerTests/ImageUtilTests.m @@ -72,74 +72,4 @@ - (void)testScaledGIFImage_ShouldBeScaled { } } -- (void)testScaledImage_TallImage_ShouldBeScaledBelowMaxHeight { - UIImage *image = [UIImage imageWithData:ImagePickerTestImages.JPGTallTestData]; - XCTAssertEqual(image.size.width, 4); - XCTAssertEqual(image.size.height, 7); - UIImage *newImage = [FLTImagePickerImageUtil scaledImage:image - maxWidth:@5 - maxHeight:@5 - isMetadataAvailable:YES]; - - XCTAssertEqual(newImage.size.width, 3); - XCTAssertEqual(newImage.size.height, 5); -} - -- (void)testScaledImage_TallImage_ShouldBeScaledBelowMaxWidth { - UIImage *image = [UIImage imageWithData:ImagePickerTestImages.JPGTallTestData]; - UIImage *newImage = [FLTImagePickerImageUtil scaledImage:image - maxWidth:@3 - maxHeight:@10 - isMetadataAvailable:YES]; - - XCTAssertEqual(newImage.size.width, 3); - XCTAssertEqual(newImage.size.height, 5); -} - -- (void)testScaledImage_TallImage_ShouldNotBeScaledAboveOriginaWidthOrHeight { - UIImage *image = [UIImage imageWithData:ImagePickerTestImages.JPGTallTestData]; - UIImage *newImage = [FLTImagePickerImageUtil scaledImage:image - maxWidth:@10 - maxHeight:@10 - isMetadataAvailable:YES]; - - XCTAssertEqual(newImage.size.width, 4); - XCTAssertEqual(newImage.size.height, 7); -} - -- (void)testScaledImage_WideImage_ShouldBeScaledBelowMaxHeight { - UIImage *image = [UIImage imageWithData:ImagePickerTestImages.JPGTestData]; - XCTAssertEqual(image.size.width, 12); - XCTAssertEqual(image.size.height, 7); - UIImage *newImage = [FLTImagePickerImageUtil scaledImage:image - maxWidth:@20 - maxHeight:@6 - isMetadataAvailable:YES]; - - XCTAssertEqual(newImage.size.width, 10); - XCTAssertEqual(newImage.size.height, 6); -} - -- (void)testScaledImage_WideImage_ShouldBeScaledBelowMaxWidth { - UIImage *image = [UIImage imageWithData:ImagePickerTestImages.JPGTestData]; - UIImage *newImage = [FLTImagePickerImageUtil scaledImage:image - maxWidth:@10 - maxHeight:@10 - isMetadataAvailable:YES]; - - XCTAssertEqual(newImage.size.width, 10); - XCTAssertEqual(newImage.size.height, 6); -} - -- (void)testScaledImage_WideImage_ShouldNotBeScaledAboveOriginaWidthOrHeight { - UIImage *image = [UIImage imageWithData:ImagePickerTestImages.JPGTestData]; - UIImage *newImage = [FLTImagePickerImageUtil scaledImage:image - maxWidth:@100 - maxHeight:@100 - isMetadataAvailable:YES]; - - XCTAssertEqual(newImage.size.width, 12); - XCTAssertEqual(newImage.size.height, 7); -} - @end diff --git a/packages/image_picker/image_picker_ios/example/ios/TestImages/jpgImageTall.jpg b/packages/image_picker/image_picker_ios/example/ios/TestImages/jpgImageTall.jpg deleted file mode 100644 index d7c137eb5ae1..000000000000 Binary files a/packages/image_picker/image_picker_ios/example/ios/TestImages/jpgImageTall.jpg and /dev/null differ diff --git a/packages/image_picker/image_picker_ios/ios/Classes/FLTImagePickerImageUtil.m b/packages/image_picker/image_picker_ios/ios/Classes/FLTImagePickerImageUtil.m index 245a66177930..6adfd50402af 100644 --- a/packages/image_picker/image_picker_ios/ios/Classes/FLTImagePickerImageUtil.m +++ b/packages/image_picker/image_picker_ios/ios/Classes/FLTImagePickerImageUtil.m @@ -34,27 +34,39 @@ + (UIImage *)scaledImage:(UIImage *)image isMetadataAvailable:(BOOL)isMetadataAvailable { double originalWidth = image.size.width; double originalHeight = image.size.height; - double aspectRatio = originalWidth / originalHeight; bool hasMaxWidth = maxWidth != nil; bool hasMaxHeight = maxHeight != nil; - double width = hasMaxWidth ? MIN(round([maxWidth doubleValue]), originalWidth) : originalWidth; - double height = - hasMaxHeight ? MIN(round([maxHeight doubleValue]), originalHeight) : originalHeight; + double width = hasMaxWidth ? MIN([maxWidth doubleValue], originalWidth) : originalWidth; + double height = hasMaxHeight ? MIN([maxHeight doubleValue], originalHeight) : originalHeight; bool shouldDownscaleWidth = hasMaxWidth && [maxWidth doubleValue] < originalWidth; bool shouldDownscaleHeight = hasMaxHeight && [maxHeight doubleValue] < originalHeight; bool shouldDownscale = shouldDownscaleWidth || shouldDownscaleHeight; if (shouldDownscale) { - double widthForMaxHeight = height * aspectRatio; - double heightForMaxWidth = width / aspectRatio; - - if (heightForMaxWidth > height) { - width = round(widthForMaxHeight); + double downscaledWidth = floor((height / originalHeight) * originalWidth); + double downscaledHeight = floor((width / originalWidth) * originalHeight); + + if (width < height) { + if (!hasMaxWidth) { + width = downscaledWidth; + } else { + height = downscaledHeight; + } + } else if (height < width) { + if (!hasMaxHeight) { + height = downscaledHeight; + } else { + width = downscaledWidth; + } } else { - height = round(heightForMaxWidth); + if (originalWidth < originalHeight) { + width = downscaledWidth; + } else if (originalHeight < originalWidth) { + height = downscaledHeight; + } } } diff --git a/packages/image_picker/image_picker_ios/pubspec.yaml b/packages/image_picker/image_picker_ios/pubspec.yaml index e7f709214d9e..cec65a9719e7 100755 --- a/packages/image_picker/image_picker_ios/pubspec.yaml +++ b/packages/image_picker/image_picker_ios/pubspec.yaml @@ -2,7 +2,7 @@ name: image_picker_ios description: iOS implementation of the image_picker plugin. repository: https://github.com/flutter/packages/tree/main/packages/image_picker/image_picker_ios issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+image_picker%22 -version: 0.8.9 +version: 0.8.8+4 environment: sdk: ">=3.0.0 <4.0.0" @@ -24,7 +24,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^13.0.0 topics: diff --git a/packages/image_picker/image_picker_linux/pubspec.yaml b/packages/image_picker/image_picker_linux/pubspec.yaml index 9663934d0014..6f9e4017de9d 100644 --- a/packages/image_picker/image_picker_linux/pubspec.yaml +++ b/packages/image_picker/image_picker_linux/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - image-picker diff --git a/packages/image_picker/image_picker_linux/test/image_picker_linux_test.mocks.dart b/packages/image_picker/image_picker_linux/test/image_picker_linux_test.mocks.dart index 13ec1065c0e5..6cde8261f501 100644 --- a/packages/image_picker/image_picker_linux/test/image_picker_linux_test.mocks.dart +++ b/packages/image_picker/image_picker_linux/test/image_picker_linux_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in image_picker_linux/test/image_picker_linux_test.dart. // Do not manually edit this file. @@ -13,8 +13,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -49,7 +47,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future<_i2.XFile?>.value(), ) as _i3.Future<_i2.XFile?>); - @override _i3.Future> openFiles({ List<_i2.XTypeGroup>? acceptedTypeGroups, @@ -68,7 +65,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future>.value(<_i2.XFile>[]), ) as _i3.Future>); - @override _i3.Future getSavePath({ List<_i2.XTypeGroup>? acceptedTypeGroups, @@ -89,24 +85,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future.value(), ) as _i3.Future); - - @override - _i3.Future<_i2.FileSaveLocation?> getSaveLocation({ - List<_i2.XTypeGroup>? acceptedTypeGroups, - _i2.SaveDialogOptions? options = const _i2.SaveDialogOptions(), - }) => - (super.noSuchMethod( - Invocation.method( - #getSaveLocation, - [], - { - #acceptedTypeGroups: acceptedTypeGroups, - #options: options, - }, - ), - returnValue: _i3.Future<_i2.FileSaveLocation?>.value(), - ) as _i3.Future<_i2.FileSaveLocation?>); - @override _i3.Future getDirectoryPath({ String? initialDirectory, @@ -123,7 +101,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future> getDirectoryPaths({ String? initialDirectory, diff --git a/packages/image_picker/image_picker_macos/pubspec.yaml b/packages/image_picker/image_picker_macos/pubspec.yaml index 3d147a700a90..fc0f2887dd64 100644 --- a/packages/image_picker/image_picker_macos/pubspec.yaml +++ b/packages/image_picker/image_picker_macos/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - image-picker diff --git a/packages/image_picker/image_picker_macos/test/image_picker_macos_test.mocks.dart b/packages/image_picker/image_picker_macos/test/image_picker_macos_test.mocks.dart index c3c018a9ad27..5b8769c27aad 100644 --- a/packages/image_picker/image_picker_macos/test/image_picker_macos_test.mocks.dart +++ b/packages/image_picker/image_picker_macos/test/image_picker_macos_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in image_picker_macos/test/image_picker_macos_test.dart. // Do not manually edit this file. @@ -13,8 +13,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -49,7 +47,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future<_i2.XFile?>.value(), ) as _i3.Future<_i2.XFile?>); - @override _i3.Future> openFiles({ List<_i2.XTypeGroup>? acceptedTypeGroups, @@ -68,7 +65,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future>.value(<_i2.XFile>[]), ) as _i3.Future>); - @override _i3.Future getSavePath({ List<_i2.XTypeGroup>? acceptedTypeGroups, @@ -89,24 +85,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future.value(), ) as _i3.Future); - - @override - _i3.Future<_i2.FileSaveLocation?> getSaveLocation({ - List<_i2.XTypeGroup>? acceptedTypeGroups, - _i2.SaveDialogOptions? options = const _i2.SaveDialogOptions(), - }) => - (super.noSuchMethod( - Invocation.method( - #getSaveLocation, - [], - { - #acceptedTypeGroups: acceptedTypeGroups, - #options: options, - }, - ), - returnValue: _i3.Future<_i2.FileSaveLocation?>.value(), - ) as _i3.Future<_i2.FileSaveLocation?>); - @override _i3.Future getDirectoryPath({ String? initialDirectory, @@ -123,7 +101,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future> getDirectoryPaths({ String? initialDirectory, diff --git a/packages/image_picker/image_picker_windows/pubspec.yaml b/packages/image_picker/image_picker_windows/pubspec.yaml index d3cc23b41e51..de1ef768a491 100644 --- a/packages/image_picker/image_picker_windows/pubspec.yaml +++ b/packages/image_picker/image_picker_windows/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - image-picker diff --git a/packages/image_picker/image_picker_windows/test/image_picker_windows_test.mocks.dart b/packages/image_picker/image_picker_windows/test/image_picker_windows_test.mocks.dart index 04430950595a..32fb38026c14 100644 --- a/packages/image_picker/image_picker_windows/test/image_picker_windows_test.mocks.dart +++ b/packages/image_picker/image_picker_windows/test/image_picker_windows_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in image_picker_windows/test/image_picker_windows_test.dart. // Do not manually edit this file. @@ -13,8 +13,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -49,7 +47,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future<_i2.XFile?>.value(), ) as _i3.Future<_i2.XFile?>); - @override _i3.Future> openFiles({ List<_i2.XTypeGroup>? acceptedTypeGroups, @@ -68,7 +65,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future>.value(<_i2.XFile>[]), ) as _i3.Future>); - @override _i3.Future getSavePath({ List<_i2.XTypeGroup>? acceptedTypeGroups, @@ -89,24 +85,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future.value(), ) as _i3.Future); - - @override - _i3.Future<_i2.FileSaveLocation?> getSaveLocation({ - List<_i2.XTypeGroup>? acceptedTypeGroups, - _i2.SaveDialogOptions? options = const _i2.SaveDialogOptions(), - }) => - (super.noSuchMethod( - Invocation.method( - #getSaveLocation, - [], - { - #acceptedTypeGroups: acceptedTypeGroups, - #options: options, - }, - ), - returnValue: _i3.Future<_i2.FileSaveLocation?>.value(), - ) as _i3.Future<_i2.FileSaveLocation?>); - @override _i3.Future getDirectoryPath({ String? initialDirectory, @@ -123,7 +101,6 @@ class MockFileSelectorPlatform extends _i1.Mock ), returnValue: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future> getDirectoryPaths({ String? initialDirectory, diff --git a/packages/in_app_purchase/in_app_purchase/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/in_app_purchase/in_app_purchase/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/in_app_purchase/in_app_purchase/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/in_app_purchase/in_app_purchase/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/in_app_purchase/in_app_purchase/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/in_app_purchase/in_app_purchase/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/in_app_purchase/in_app_purchase/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/in_app_purchase/in_app_purchase/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/in_app_purchase/in_app_purchase_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/in_app_purchase/in_app_purchase_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/in_app_purchase/in_app_purchase_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/in_app_purchase/in_app_purchase_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/in_app_purchase/in_app_purchase_android/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/in_app_purchase/in_app_purchase_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/in_app_purchase/in_app_purchase_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml index bf35d43b6091..e353d5938f0a 100644 --- a/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_android/pubspec.yaml @@ -28,7 +28,7 @@ dev_dependencies: flutter_test: sdk: flutter json_serializable: ^6.3.1 - mockito: 5.4.3 + mockito: 5.4.1 test: ^1.16.0 topics: diff --git a/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml b/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml index 2f062e1b25b5..18a26ba68b84 100644 --- a/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml +++ b/packages/in_app_purchase/in_app_purchase_platform_interface/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - in-app-purchase diff --git a/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcodeproj/project.pbxproj b/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcodeproj/project.pbxproj index d5047192ee06..4b24d767a226 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcodeproj/project.pbxproj @@ -257,7 +257,7 @@ isa = PBXProject; attributes = { DefaultBuildSystemTypeForWorkspace = Original; - LastUpgradeCheck = 1430; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = "The Flutter Authors"; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index fc4170f31765..a8adf88572cd 100644 --- a/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/in_app_purchase/in_app_purchase_storekit/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - Flutter Example - -```dart -// "flutter" is a resource in Assets.xcassets. -final Image xcassetImage = Image( - image: IosPlatformImages.load('flutter'), - semanticLabel: 'Flutter logo', -); +``` dart +// Import package +import 'package:ios_platform_images/ios_platform_images.dart'; + +Widget build(BuildContext context) { + return MaterialApp( + home: Scaffold( + body: Center( + child: Image(image: IosPlatformImages.load("flutter")), + ), + //.. + ), + ); +} ``` `IosPlatformImages.load` works similarly to [`UIImage(named:)`](https://developer.apple.com/documentation/uikit/uiimage/1624146-imagenamed). diff --git a/packages/ios_platform_images/example/lib/main.dart b/packages/ios_platform_images/example/lib/main.dart index a47c81876521..9c80c3281245 100644 --- a/packages/ios_platform_images/example/lib/main.dart +++ b/packages/ios_platform_images/example/lib/main.dart @@ -28,20 +28,17 @@ class _MyAppState extends State { @override Widget build(BuildContext context) { - // #docregion Usage - // "flutter" is a resource in Assets.xcassets. - final Image xcassetImage = Image( - image: IosPlatformImages.load('flutter'), - semanticLabel: 'Flutter logo', - ); - // #enddocregion Usage return MaterialApp( home: Scaffold( appBar: AppBar( title: const Text('Plugin example app'), ), body: Center( - child: xcassetImage, + // "flutter" is a resource in Assets.xcassets. + child: Image( + image: IosPlatformImages.load('flutter'), + semanticLabel: 'Flutter logo', + ), ), ), ); diff --git a/packages/ios_platform_images/pubspec.yaml b/packages/ios_platform_images/pubspec.yaml index d800920290e5..a5f36642da51 100644 --- a/packages/ios_platform_images/pubspec.yaml +++ b/packages/ios_platform_images/pubspec.yaml @@ -2,7 +2,7 @@ name: ios_platform_images description: A plugin to share images between Flutter and iOS in add-to-app setups. repository: https://github.com/flutter/packages/tree/main/packages/ios_platform_images issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+ios_platform_images%22 -version: 0.2.3+1 +version: 0.2.3 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/local_auth/local_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/local_auth/local_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/local_auth/local_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/local_auth/local_auth/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/local_auth/local_auth/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/local_auth/local_auth/example/android/gradle/wrapper/gradle-wrapper.properties index a4f684d08a81..fe8a7a0dc9bd 100644 --- a/packages/local_auth/local_auth/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/local_auth/local_auth/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/local_auth/local_auth/pubspec.yaml b/packages/local_auth/local_auth/pubspec.yaml index f736285f4034..a367c96ca56d 100644 --- a/packages/local_auth/local_auth/pubspec.yaml +++ b/packages/local_auth/local_auth/pubspec.yaml @@ -32,7 +32,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 plugin_platform_interface: ^2.1.2 topics: diff --git a/packages/local_auth/local_auth_android/CHANGELOG.md b/packages/local_auth/local_auth_android/CHANGELOG.md index 8d744bc2b43a..020b5b2fcdbf 100644 --- a/packages/local_auth/local_auth_android/CHANGELOG.md +++ b/packages/local_auth/local_auth_android/CHANGELOG.md @@ -1,7 +1,3 @@ -## 1.0.36 - -* Updates androidx.fragment version to 1.6.2. - ## 1.0.35 * Updates androidx.fragment version to 1.6.1. diff --git a/packages/local_auth/local_auth_android/android/build.gradle b/packages/local_auth/local_auth_android/android/build.gradle index b91b9825a19c..013cf104c15b 100644 --- a/packages/local_auth/local_auth_android/android/build.gradle +++ b/packages/local_auth/local_auth_android/android/build.gradle @@ -61,7 +61,7 @@ android { dependencies { api "androidx.core:core:1.10.1" api "androidx.biometric:biometric:1.1.0" - api "androidx.fragment:fragment:1.6.2" + api "androidx.fragment:fragment:1.6.1" testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-inline:5.0.0' testImplementation 'org.robolectric:robolectric:4.10.3' diff --git a/packages/local_auth/local_auth_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/local_auth/local_auth_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/local_auth/local_auth_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/local_auth/local_auth_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/local_auth/local_auth_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/local_auth/local_auth_android/example/android/gradle/wrapper/gradle-wrapper.properties index a4f684d08a81..fe8a7a0dc9bd 100644 --- a/packages/local_auth/local_auth_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/local_auth/local_auth_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/local_auth/local_auth_android/pubspec.yaml b/packages/local_auth/local_auth_android/pubspec.yaml index a3d496a4f69d..eb43d6243f1e 100644 --- a/packages/local_auth/local_auth_android/pubspec.yaml +++ b/packages/local_auth/local_auth_android/pubspec.yaml @@ -2,7 +2,7 @@ name: local_auth_android description: Android implementation of the local_auth plugin. repository: https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22 -version: 1.0.36 +version: 1.0.35 environment: sdk: ">=3.0.0 <4.0.0" @@ -28,7 +28,7 @@ dev_dependencies: build_runner: ^2.3.3 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^11.0.0 topics: diff --git a/packages/local_auth/local_auth_android/test/local_auth_test.mocks.dart b/packages/local_auth/local_auth_android/test/local_auth_test.mocks.dart index 47b2ab6d1a2e..7ae4fe383aa7 100644 --- a/packages/local_auth/local_auth_android/test/local_auth_test.mocks.dart +++ b/packages/local_auth/local_auth_android/test/local_auth_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in local_auth_android/test/local_auth_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -12,8 +14,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -37,7 +37,6 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i3.Future deviceCanSupportBiometrics() => (super.noSuchMethod( Invocation.method( @@ -46,7 +45,6 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i3.Future stopAuthentication() => (super.noSuchMethod( Invocation.method( @@ -55,7 +53,6 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i3.Future> getEnrolledBiometrics() => (super.noSuchMethod( @@ -66,7 +63,6 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { returnValue: _i3.Future>.value( <_i2.AuthClassificationWrapper?>[]), ) as _i3.Future>); - @override _i3.Future<_i2.AuthResult> authenticate( _i2.AuthOptions? arg_options, diff --git a/packages/local_auth/local_auth_ios/pubspec.yaml b/packages/local_auth/local_auth_ios/pubspec.yaml index 4bef06ec9421..a4fcff5b55d7 100644 --- a/packages/local_auth/local_auth_ios/pubspec.yaml +++ b/packages/local_auth/local_auth_ios/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: build_runner: ^2.3.3 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^13.0.0 topics: diff --git a/packages/local_auth/local_auth_ios/test/local_auth_ios_test.mocks.dart b/packages/local_auth/local_auth_ios/test/local_auth_ios_test.mocks.dart index d0a6c42eb27e..97e0a9dba40d 100644 --- a/packages/local_auth/local_auth_ios/test/local_auth_ios_test.mocks.dart +++ b/packages/local_auth/local_auth_ios/test/local_auth_ios_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in local_auth_ios/test/local_auth_ios_test.dart. // Do not manually edit this file. @@ -12,8 +12,6 @@ import 'package:mockito/mockito.dart' as _i1; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -48,7 +46,6 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i3.Future deviceCanSupportBiometrics() => (super.noSuchMethod( Invocation.method( @@ -57,7 +54,6 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i3.Future> getEnrolledBiometrics() => (super.noSuchMethod( @@ -68,7 +64,6 @@ class MockLocalAuthApi extends _i1.Mock implements _i2.LocalAuthApi { returnValue: _i3.Future>.value( <_i2.AuthBiometricWrapper?>[]), ) as _i3.Future>); - @override _i3.Future<_i2.AuthResultDetails> authenticate( _i2.AuthOptions? arg_options, diff --git a/packages/local_auth/local_auth_platform_interface/pubspec.yaml b/packages/local_auth/local_auth_platform_interface/pubspec.yaml index 4b860d543a4e..f19989aab23e 100644 --- a/packages/local_auth/local_auth_platform_interface/pubspec.yaml +++ b/packages/local_auth/local_auth_platform_interface/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - authentication diff --git a/packages/metrics_center/pubspec.yaml b/packages/metrics_center/pubspec.yaml index 6740819a6006..0f2c4ed5c44c 100644 --- a/packages/metrics_center/pubspec.yaml +++ b/packages/metrics_center/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: dev_dependencies: build_runner: ^2.1.1 fake_async: ^1.2.0 - mockito: 5.4.3 + mockito: 5.4.1 test: ^1.17.11 topics: diff --git a/packages/metrics_center/test/gcs_lock_test.mocks.dart b/packages/metrics_center/test/gcs_lock_test.mocks.dart index 69ab102df039..a672212c882f 100644 --- a/packages/metrics_center/test/gcs_lock_test.mocks.dart +++ b/packages/metrics_center/test/gcs_lock_test.mocks.dart @@ -1,26 +1,25 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in metrics_center/test/gcs_lock_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i6; import 'dart:convert' as _i7; -import 'dart:typed_data' as _i9; +import 'dart:typed_data' as _i8; -import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as _i10; +import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as _i9; import 'package:googleapis/storage/v1.dart' as _i4; import 'package:googleapis_auth/src/access_credentials.dart' as _i2; import 'package:googleapis_auth/src/auth_client.dart' as _i5; import 'package:http/http.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i8; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -236,7 +235,6 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { Invocation.getter(#credentials), ), ) as _i2.AccessCredentials); - @override _i6.Future<_i3.Response> head( Uri? url, { @@ -257,7 +255,6 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { ), )), ) as _i6.Future<_i3.Response>); - @override _i6.Future<_i3.Response> get( Uri? url, { @@ -278,7 +275,6 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { ), )), ) as _i6.Future<_i3.Response>); - @override _i6.Future<_i3.Response> post( Uri? url, { @@ -309,7 +305,6 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { ), )), ) as _i6.Future<_i3.Response>); - @override _i6.Future<_i3.Response> put( Uri? url, { @@ -340,7 +335,6 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { ), )), ) as _i6.Future<_i3.Response>); - @override _i6.Future<_i3.Response> patch( Uri? url, { @@ -371,7 +365,6 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { ), )), ) as _i6.Future<_i3.Response>); - @override _i6.Future<_i3.Response> delete( Uri? url, { @@ -402,7 +395,6 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { ), )), ) as _i6.Future<_i3.Response>); - @override _i6.Future read( Uri? url, { @@ -414,18 +406,10 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { [url], {#headers: headers}, ), - returnValue: _i6.Future.value(_i8.dummyValue( - this, - Invocation.method( - #read, - [url], - {#headers: headers}, - ), - )), + returnValue: _i6.Future.value(''), ) as _i6.Future); - @override - _i6.Future<_i9.Uint8List> readBytes( + _i6.Future<_i8.Uint8List> readBytes( Uri? url, { Map? headers, }) => @@ -435,9 +419,8 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { [url], {#headers: headers}, ), - returnValue: _i6.Future<_i9.Uint8List>.value(_i9.Uint8List(0)), - ) as _i6.Future<_i9.Uint8List>); - + returnValue: _i6.Future<_i8.Uint8List>.value(_i8.Uint8List(0)), + ) as _i6.Future<_i8.Uint8List>); @override _i6.Future<_i3.StreamedResponse> send(_i3.BaseRequest? request) => (super.noSuchMethod( @@ -454,7 +437,6 @@ class MockAuthClient extends _i1.Mock implements _i5.AuthClient { ), )), ) as _i6.Future<_i3.StreamedResponse>); - @override void close() => super.noSuchMethod( Invocation.method( @@ -482,7 +464,6 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { Invocation.getter(#bucketAccessControls), ), ) as _i4.BucketAccessControlsResource); - @override _i4.BucketsResource get buckets => (super.noSuchMethod( Invocation.getter(#buckets), @@ -491,7 +472,6 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { Invocation.getter(#buckets), ), ) as _i4.BucketsResource); - @override _i4.ChannelsResource get channels => (super.noSuchMethod( Invocation.getter(#channels), @@ -500,7 +480,6 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { Invocation.getter(#channels), ), ) as _i4.ChannelsResource); - @override _i4.DefaultObjectAccessControlsResource get defaultObjectAccessControls => (super.noSuchMethod( @@ -510,7 +489,6 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { Invocation.getter(#defaultObjectAccessControls), ), ) as _i4.DefaultObjectAccessControlsResource); - @override _i4.NotificationsResource get notifications => (super.noSuchMethod( Invocation.getter(#notifications), @@ -519,7 +497,6 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { Invocation.getter(#notifications), ), ) as _i4.NotificationsResource); - @override _i4.ObjectAccessControlsResource get objectAccessControls => (super.noSuchMethod( @@ -529,7 +506,6 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { Invocation.getter(#objectAccessControls), ), ) as _i4.ObjectAccessControlsResource); - @override _i4.ObjectsResource get objects => (super.noSuchMethod( Invocation.getter(#objects), @@ -538,7 +514,6 @@ class MockStorageApi extends _i1.Mock implements _i4.StorageApi { Invocation.getter(#objects), ), ) as _i4.ObjectsResource); - @override _i4.ProjectsResource get projects => (super.noSuchMethod( Invocation.getter(#projects), @@ -625,7 +600,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.Object>); - @override _i6.Future<_i4.Object> copy( _i4.Object? request, @@ -738,7 +712,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.Object>); - @override _i6.Future delete( String? bucket, @@ -773,7 +746,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future get( String? bucket, @@ -787,7 +759,7 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? provisionalUserProject, String? userProject, String? $fields, - _i10.DownloadOptions? downloadOptions = _i10.DownloadOptions.metadata, + _i9.DownloadOptions? downloadOptions = _i9.DownloadOptions.metadata, }) => (super.noSuchMethod( Invocation.method( @@ -854,7 +826,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future); - @override _i6.Future<_i4.Policy> getIamPolicy( String? bucket, @@ -911,7 +882,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.Policy>); - @override _i6.Future<_i4.Object> insert( _i4.Object? request, @@ -928,8 +898,8 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { String? provisionalUserProject, String? userProject, String? $fields, - _i10.UploadOptions? uploadOptions = _i10.UploadOptions.defaultOptions, - _i10.Media? uploadMedia, + _i9.UploadOptions? uploadOptions = _i9.UploadOptions.defaultOptions, + _i9.Media? uploadMedia, }) => (super.noSuchMethod( Invocation.method( @@ -1008,7 +978,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.Object>); - @override _i6.Future<_i4.Objects> list( String? bucket, { @@ -1088,7 +1057,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.Objects>); - @override _i6.Future<_i4.Object> patch( _i4.Object? request, @@ -1173,7 +1141,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.Object>); - @override _i6.Future<_i4.RewriteResponse> rewrite( _i4.Object? request, @@ -1296,7 +1263,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.RewriteResponse>); - @override _i6.Future<_i4.Policy> setIamPolicy( _i4.Policy? request, @@ -1357,7 +1323,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.Policy>); - @override _i6.Future<_i4.TestIamPermissionsResponse> testIamPermissions( String? bucket, @@ -1421,7 +1386,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.TestIamPermissionsResponse>); - @override _i6.Future<_i4.Object> update( _i4.Object? request, @@ -1506,7 +1470,6 @@ class MockObjectsResource extends _i1.Mock implements _i4.ObjectsResource { ), )), ) as _i6.Future<_i4.Object>); - @override _i6.Future<_i4.Channel> watchAll( _i4.Channel? request, diff --git a/packages/metrics_center/test/skiaperf_test.mocks.dart b/packages/metrics_center/test/skiaperf_test.mocks.dart index 271e334ff322..70f8ae63f8f5 100644 --- a/packages/metrics_center/test/skiaperf_test.mocks.dart +++ b/packages/metrics_center/test/skiaperf_test.mocks.dart @@ -1,21 +1,20 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in metrics_center/test/skiaperf_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i2; import 'package:gcloud/common.dart' as _i4; import 'package:gcloud/storage.dart' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i5; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -106,27 +105,16 @@ class MockBucket extends _i1.Mock implements _i3.Bucket { @override String get bucketName => (super.noSuchMethod( Invocation.getter(#bucketName), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#bucketName), - ), + returnValue: '', ) as String); - @override String absoluteObjectName(String? objectName) => (super.noSuchMethod( Invocation.method( #absoluteObjectName, [objectName], ), - returnValue: _i5.dummyValue( - this, - Invocation.method( - #absoluteObjectName, - [objectName], - ), - ), + returnValue: '', ) as String); - @override _i2.StreamSink> write( String? objectName, { @@ -163,7 +151,6 @@ class MockBucket extends _i1.Mock implements _i3.Bucket { ), ), ) as _i2.StreamSink>); - @override _i2.Future<_i3.ObjectInfo> writeBytes( String? name, @@ -204,7 +191,6 @@ class MockBucket extends _i1.Mock implements _i3.Bucket { ), )), ) as _i2.Future<_i3.ObjectInfo>); - @override _i2.Stream> read( String? objectName, { @@ -222,7 +208,6 @@ class MockBucket extends _i1.Mock implements _i3.Bucket { ), returnValue: _i2.Stream>.empty(), ) as _i2.Stream>); - @override _i2.Future<_i3.ObjectInfo> info(String? name) => (super.noSuchMethod( Invocation.method( @@ -237,7 +222,6 @@ class MockBucket extends _i1.Mock implements _i3.Bucket { ), )), ) as _i2.Future<_i3.ObjectInfo>); - @override _i2.Future delete(String? name) => (super.noSuchMethod( Invocation.method( @@ -246,7 +230,6 @@ class MockBucket extends _i1.Mock implements _i3.Bucket { ), returnValue: _i2.Future.value(), ) as _i2.Future); - @override _i2.Future updateMetadata( String? objectName, @@ -262,7 +245,6 @@ class MockBucket extends _i1.Mock implements _i3.Bucket { ), returnValue: _i2.Future.value(), ) as _i2.Future); - @override _i2.Stream<_i3.BucketEntry> list({ String? prefix, @@ -279,7 +261,6 @@ class MockBucket extends _i1.Mock implements _i3.Bucket { ), returnValue: _i2.Stream<_i3.BucketEntry>.empty(), ) as _i2.Stream<_i3.BucketEntry>); - @override _i2.Future<_i4.Page<_i3.BucketEntry>> page({ String? prefix, @@ -323,18 +304,13 @@ class MockObjectInfo extends _i1.Mock implements _i3.ObjectInfo { @override String get name => (super.noSuchMethod( Invocation.getter(#name), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#name), - ), + returnValue: '', ) as String); - @override int get length => (super.noSuchMethod( Invocation.getter(#length), returnValue: 0, ) as int); - @override DateTime get updated => (super.noSuchMethod( Invocation.getter(#updated), @@ -343,28 +319,21 @@ class MockObjectInfo extends _i1.Mock implements _i3.ObjectInfo { Invocation.getter(#updated), ), ) as DateTime); - @override String get etag => (super.noSuchMethod( Invocation.getter(#etag), - returnValue: _i5.dummyValue( - this, - Invocation.getter(#etag), - ), + returnValue: '', ) as String); - @override List get md5Hash => (super.noSuchMethod( Invocation.getter(#md5Hash), returnValue: [], ) as List); - @override int get crc32CChecksum => (super.noSuchMethod( Invocation.getter(#crc32CChecksum), returnValue: 0, ) as int); - @override Uri get downloadLink => (super.noSuchMethod( Invocation.getter(#downloadLink), @@ -373,7 +342,6 @@ class MockObjectInfo extends _i1.Mock implements _i3.ObjectInfo { Invocation.getter(#downloadLink), ), ) as Uri); - @override _i3.ObjectGeneration get generation => (super.noSuchMethod( Invocation.getter(#generation), @@ -382,7 +350,6 @@ class MockObjectInfo extends _i1.Mock implements _i3.ObjectInfo { Invocation.getter(#generation), ), ) as _i3.ObjectGeneration); - @override _i3.ObjectMetadata get metadata => (super.noSuchMethod( Invocation.getter(#metadata), diff --git a/packages/multicast_dns/CHANGELOG.md b/packages/multicast_dns/CHANGELOG.md index eb612875066b..85a2f7bef5d2 100644 --- a/packages/multicast_dns/CHANGELOG.md +++ b/packages/multicast_dns/CHANGELOG.md @@ -1,7 +1,3 @@ -## 0.3.2+6 - -* Improves links in README.md. - ## 0.3.2+5 * Updates `PendingRequest` to be a `base class` for Dart 3.0 compatibility. diff --git a/packages/multicast_dns/README.md b/packages/multicast_dns/README.md index 10cd33e4bb63..26226f6ce133 100644 --- a/packages/multicast_dns/README.md +++ b/packages/multicast_dns/README.md @@ -6,9 +6,15 @@ https://pub.dartlang.org/packages/multicast_dns) A Dart package to do service discovery over multicast DNS (mDNS), Bonjour, and Avahi. ## Usage - To use this package, add `multicast_dns` as a -[dependency in your pubspec.yaml file](https://pub.dev/packages/multicast_dns/install). +[dependency in your pubspec.yaml file](https://flutter.io/platform-plugins/). + +## Example + +Import the library via +``` dart +import 'package:multicast_dns/multicast_dns.dart'; +``` -[The example](https://pub.dev/packages/multicast_dns/example) demonstrates how -to use the `MDnsClient` Dart class in your code. +Then use the `MDnsClient` Dart class in your code. To see how this is done, +check out the [example app](example/main.dart). diff --git a/packages/multicast_dns/pubspec.yaml b/packages/multicast_dns/pubspec.yaml index a0211e7a733a..59b907fbf3d0 100644 --- a/packages/multicast_dns/pubspec.yaml +++ b/packages/multicast_dns/pubspec.yaml @@ -2,7 +2,7 @@ name: multicast_dns description: Dart package for performing mDNS queries (e.g. Bonjour, Avahi). repository: https://github.com/flutter/packages/tree/main/packages/multicast_dns issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+multicast_dns%22 -version: 0.3.2+6 +version: 0.3.2+5 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/palette_generator/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/palette_generator/example/android/gradle/wrapper/gradle-wrapper.properties index a8080642df08..7d4cca5688e9 100644 --- a/packages/palette_generator/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/palette_generator/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/path_provider/path_provider/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/path_provider/path_provider/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/path_provider/path_provider/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/path_provider/path_provider/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/path_provider/path_provider/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/path_provider/path_provider/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/path_provider/path_provider/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/path_provider/path_provider/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart index 9a4a5d6b21f5..f26f88b46528 100644 --- a/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider/example/integration_test/path_provider_test.dart @@ -117,13 +117,6 @@ void _verifySampleFile(Directory? directory, String name) { file.writeAsStringSync('Hello world!'); expect(file.readAsStringSync(), 'Hello world!'); - // This check intentionally avoids using Directory.listSync on Android due to - // https://github.com/dart-lang/sdk/issues/54287. - if (Platform.isAndroid) { - expect( - Process.runSync('ls', [directory.path]).stdout, contains(name)); - } else { - expect(directory.listSync(), isNotEmpty); - } + expect(directory.listSync(), isNotEmpty); file.deleteSync(); } diff --git a/packages/path_provider/path_provider_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/path_provider/path_provider_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/path_provider/path_provider_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/path_provider/path_provider_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/path_provider/path_provider_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/path_provider/path_provider_android/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/path_provider/path_provider_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/path_provider/path_provider_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart b/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart index 8f4422613c2b..1403d932d292 100644 --- a/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart +++ b/packages/path_provider/path_provider_android/example/integration_test/path_provider_test.dart @@ -99,9 +99,6 @@ void _verifySampleFile(String? directoryPath, String name) { file.writeAsStringSync('Hello world!'); expect(file.readAsStringSync(), 'Hello world!'); - // This check intentionally avoids using Directory.listSync due to - // https://github.com/dart-lang/sdk/issues/54287. - expect( - Process.runSync('ls', [directory.path]).stdout, contains(name)); + expect(directory.listSync(), isNotEmpty); file.deleteSync(); } diff --git a/packages/path_provider/path_provider_foundation/pubspec.yaml b/packages/path_provider/path_provider_foundation/pubspec.yaml index ef8aa3751024..32d52af69b5c 100644 --- a/packages/path_provider/path_provider_foundation/pubspec.yaml +++ b/packages/path_provider/path_provider_foundation/pubspec.yaml @@ -30,7 +30,7 @@ dev_dependencies: build_runner: ^2.3.2 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 path: ^1.8.0 pigeon: ^10.1.3 diff --git a/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.mocks.dart b/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.mocks.dart index d17971c007cd..3a6b0f19b1cb 100644 --- a/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.mocks.dart +++ b/packages/path_provider/path_provider_foundation/test/path_provider_foundation_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in path_provider_foundation/test/path_provider_foundation_test.dart. // Do not manually edit this file. @@ -12,8 +12,6 @@ import 'messages_test.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -36,7 +34,6 @@ class MockTestPathProviderApi extends _i1.Mock #getDirectoryPath, [type], )) as String?); - @override String? getContainerPath(String? appGroupIdentifier) => (super.noSuchMethod(Invocation.method( diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index 54a50c319ef1..d58c78c27e0b 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,20 +1,6 @@ -## 15.0.2 - -* Prevents optional and non-positional parameters in Flutter APIs. -* [dart] Fixes named parameters in test output of host API methods. - -## 15.0.1 - -* [java] Adds @CanIgnoreReturnValue annotation to class builder. - -## 15.0.0 - -* **Breaking Change** [kotlin] Updates Flutter API to use new errorClassName. - -## 14.0.1 +## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Updates issue_tracker link. ## 14.0.0 diff --git a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java index 5d1b693b8230..319780d7b71f 100644 --- a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java +++ b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java @@ -4,9 +4,6 @@ // Autogenerated from Pigeon, do not edit directly. // See also: https://pub.dev/packages/pigeon -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -15,8 +12,6 @@ import io.flutter.plugin.common.MessageCodec; import io.flutter.plugin.common.StandardMessageCodec; import java.io.ByteArrayOutputStream; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; @@ -66,10 +61,6 @@ protected static FlutterError createConnectionError(@NonNull String channelName) "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); } - @Target(METHOD) - @Retention(CLASS) - @interface CanIgnoreReturnValue {} - public enum Code { ONE(0), TWO(1); @@ -136,7 +127,6 @@ public static final class Builder { private @Nullable String name; - @CanIgnoreReturnValue public @NonNull Builder setName(@Nullable String setterArg) { this.name = setterArg; return this; @@ -144,7 +134,6 @@ public static final class Builder { private @Nullable String description; - @CanIgnoreReturnValue public @NonNull Builder setDescription(@Nullable String setterArg) { this.description = setterArg; return this; @@ -152,7 +141,6 @@ public static final class Builder { private @Nullable Code code; - @CanIgnoreReturnValue public @NonNull Builder setCode(@NonNull Code setterArg) { this.code = setterArg; return this; @@ -160,7 +148,6 @@ public static final class Builder { private @Nullable Map data; - @CanIgnoreReturnValue public @NonNull Builder setData(@NonNull Map setterArg) { this.data = setterArg; return this; diff --git a/packages/pigeon/example/app/android/gradle/wrapper/gradle-wrapper.properties b/packages/pigeon/example/app/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/pigeon/example/app/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/pigeon/example/app/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/pigeon/lib/ast.dart b/packages/pigeon/lib/ast.dart index 9d79a781afbd..261ba62040d3 100644 --- a/packages/pigeon/lib/ast.dart +++ b/packages/pigeon/lib/ast.dart @@ -277,7 +277,7 @@ class Parameter extends NamedType { bool? isPositional, bool? isRequired, super.documentationComments, - }) : isNamed = isNamed ?? false, + }) : isNamed = isNamed ?? true, isOptional = isOptional ?? false, isPositional = isPositional ?? true, isRequired = isRequired ?? true; diff --git a/packages/pigeon/lib/dart_generator.dart b/packages/pigeon/lib/dart_generator.dart index 52e2d0e68d95..1f0b4dac38c8 100644 --- a/packages/pigeon/lib/dart_generator.dart +++ b/packages/pigeon/lib/dart_generator.dart @@ -418,9 +418,9 @@ $resultAt != null } }); final Iterable argNames = - indexMap(func.parameters, (int index, Parameter field) { + indexMap(func.parameters, (int index, NamedType field) { final String name = _getSafeArgumentName(index, field); - return '${field.isNamed ? '${field.name}: ' : ''}$name${field.type.isNullable ? '' : '!'}'; + return '$name${field.type.isNullable ? '' : '!'}'; }); call = 'api.${func.name}(${argNames.join(', ')})'; } diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index a510b55bd74c..050bbacb974e 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -13,7 +13,7 @@ import 'ast.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '15.0.2'; +const String pigeonVersion = '14.0.0'; /// Read all the content from [stdin] to a String. String readStdin() { diff --git a/packages/pigeon/lib/java_generator.dart b/packages/pigeon/lib/java_generator.dart index 55866c7d59d9..16e806a170b4 100644 --- a/packages/pigeon/lib/java_generator.dart +++ b/packages/pigeon/lib/java_generator.dart @@ -116,12 +116,6 @@ class JavaGenerator extends StructuredGenerator { indent.writeln('package ${generatorOptions.package};'); indent.newln(); } - if (root.classes.isNotEmpty) { - indent.writeln('import static java.lang.annotation.ElementType.METHOD;'); - indent - .writeln('import static java.lang.annotation.RetentionPolicy.CLASS;'); - indent.newln(); - } indent.writeln('import android.util.Log;'); indent.writeln('import androidx.annotation.NonNull;'); indent.writeln('import androidx.annotation.Nullable;'); @@ -130,10 +124,6 @@ class JavaGenerator extends StructuredGenerator { indent.writeln('import io.flutter.plugin.common.MessageCodec;'); indent.writeln('import io.flutter.plugin.common.StandardMessageCodec;'); indent.writeln('import java.io.ByteArrayOutputStream;'); - if (root.classes.isNotEmpty) { - indent.writeln('import java.lang.annotation.Retention;'); - indent.writeln('import java.lang.annotation.Target;'); - } indent.writeln('import java.nio.ByteBuffer;'); indent.writeln('import java.util.ArrayList;'); indent.writeln('import java.util.Arrays;'); @@ -300,7 +290,6 @@ class JavaGenerator extends StructuredGenerator { indent.writeln( 'private @Nullable ${hostDatatype.datatype} ${field.name};'); indent.newln(); - indent.writeln('@CanIgnoreReturnValue'); indent.writeScoped( 'public @NonNull Builder ${_makeSetter(field)}($nullability ${hostDatatype.datatype} setterArg) {', '}', () { @@ -950,17 +939,6 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { }); } - // We are emitting our own definition of [@CanIgnoreReturnValue] to support - // clients who use CheckReturnValue, without having to force Pigeon clients - // to take a new dependency on error_prone_annotations. - void _writeCanIgnoreReturnValueAnnotation( - JavaOptions opt, Root root, Indent indent) { - indent.newln(); - indent.writeln('@Target(METHOD)'); - indent.writeln('@Retention(CLASS)'); - indent.writeln('@interface CanIgnoreReturnValue {}'); - } - @override void writeGeneralUtilities( JavaOptions generatorOptions, @@ -983,9 +961,6 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { indent.newln(); _writeCreateConnectionError(indent); } - if (root.classes.isNotEmpty) { - _writeCanIgnoreReturnValueAnnotation(generatorOptions, root, indent); - } } @override diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 88ffb487406e..e8d69ebef5f0 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -358,7 +358,6 @@ class KotlinGenerator extends StructuredGenerator { }); }); - final String errorClassName = _getErrorClassName(generatorOptions); for (final Method func in api.methods) { final String returnType = func.returnType.isVoid ? 'Unit' @@ -397,12 +396,12 @@ class KotlinGenerator extends StructuredGenerator { indent.writeScoped('if (it is List<*>) {', '} ', () { indent.writeScoped('if (it.size > 1) {', '} ', () { indent.writeln( - 'callback(Result.failure($errorClassName(it[0] as String, it[1] as String, it[2] as String?)))'); + 'callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))'); }, addTrailingNewline: false); if (!func.returnType.isNullable && !func.returnType.isVoid) { indent.addScoped('else if (it[0] == null) {', '} ', () { indent.writeln( - 'callback(Result.failure($errorClassName("null-error", "Flutter api returned null value for non-null return value.", "")))'); + 'callback(Result.failure(FlutterError("null-error", "Flutter api returned null value for non-null return value.", "")))'); }, addTrailingNewline: false); } indent.addScoped('else {', '}', () { @@ -682,8 +681,8 @@ class KotlinGenerator extends StructuredGenerator { indent.newln(); indent.write('private fun wrapError(exception: Throwable): List '); indent.addScoped('{', '}', () { - indent - .write('if (exception is ${_getErrorClassName(generatorOptions)}) '); + indent.write( + 'if (exception is ${generatorOptions.errorClassName ?? "FlutterError"}) '); indent.addScoped('{', '}', () { indent.write('return '); indent.addScoped('listOf(', ')', () { @@ -714,7 +713,7 @@ class KotlinGenerator extends StructuredGenerator { indent.writeln( ' * @property details The error details. Must be a datatype supported by the api codec.'); indent.writeln(' */'); - indent.write('class ${_getErrorClassName(generatorOptions)} '); + indent.write('class ${generatorOptions.errorClassName ?? "FlutterError"} '); indent.addScoped('(', ')', () { indent.writeln('val code: String,'); indent.writeln('override val message: String? = null,'); @@ -723,15 +722,13 @@ class KotlinGenerator extends StructuredGenerator { indent.addln(' : Throwable()'); } - void _writeCreateConnectionError( - KotlinOptions generatorOptions, Indent indent) { - final String errorClassName = _getErrorClassName(generatorOptions); + void _writeCreateConnectionError(Indent indent) { indent.newln(); indent.write( - 'private fun createConnectionError(channelName: String): $errorClassName '); + 'private fun createConnectionError(channelName: String): FlutterError '); indent.addScoped('{', '}', () { indent.write( - 'return $errorClassName("channel-error", "Unable to establish connection on channel: \'\$channelName\'.", "")'); + 'return FlutterError("channel-error", "Unable to establish connection on channel: \'\$channelName\'.", "")'); }); } @@ -752,7 +749,7 @@ class KotlinGenerator extends StructuredGenerator { _writeWrapError(generatorOptions, indent); } if (hasFlutterApi) { - _writeCreateConnectionError(generatorOptions, indent); + _writeCreateConnectionError(indent); } _writeErrorClass(generatorOptions, indent); } @@ -766,9 +763,6 @@ HostDatatype _getHostDatatype(Root root, NamedType field) { /// Calculates the name of the codec that will be generated for [api]. String _getCodecName(Api api) => '${api.name}Codec'; -String _getErrorClassName(KotlinOptions generatorOptions) => - generatorOptions.errorClassName ?? 'FlutterError'; - String _getArgumentName(int count, NamedType argument) => argument.name.isEmpty ? 'arg$count' : argument.name; diff --git a/packages/pigeon/lib/pigeon_lib.dart b/packages/pigeon/lib/pigeon_lib.dart index e114af93caa4..032cb691788f 100644 --- a/packages/pigeon/lib/pigeon_lib.dart +++ b/packages/pigeon/lib/pigeon_lib.dart @@ -809,21 +809,6 @@ List _validateAst(Root root, String source) { lineNumber: _calculateLineNumberNullable(source, param.offset), )); } - if (api.location == ApiLocation.flutter) { - if (!param.isPositional) { - result.add(Error( - message: - 'FlutterApi method parameters must be positional, in method "${method.name}" in API: "${api.name}"', - lineNumber: _calculateLineNumberNullable(source, param.offset), - )); - } else if (param.isOptional) { - result.add(Error( - message: - 'FlutterApi method parameters must not be optional, in method "${method.name}" in API: "${api.name}"', - lineNumber: _calculateLineNumberNullable(source, param.offset), - )); - } - } } if (method.objcSelector.isNotEmpty) { if (':'.allMatches(method.objcSelector).length != @@ -1147,10 +1132,10 @@ class _RootBuilder extends dart_ast_visitor.RecursiveAstVisitor { ), name: formalParameter.name?.lexeme ?? '', offset: formalParameter.offset, - isNamed: isNamed ?? formalParameter.isNamed, - isOptional: isOptional ?? formalParameter.isOptional, - isPositional: isPositional ?? formalParameter.isPositional, - isRequired: isRequired ?? formalParameter.isRequired, + isNamed: isNamed, + isOptional: isOptional, + isPositional: isPositional, + isRequired: isRequired, defaultValue: defaultValue, ); } else if (simpleFormalParameter != null) { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java index b6a72835e4ac..60586828274c 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java @@ -7,9 +7,6 @@ package com.example.alternate_language_test_plugin; -import static java.lang.annotation.ElementType.METHOD; -import static java.lang.annotation.RetentionPolicy.CLASS; - import android.util.Log; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -18,8 +15,6 @@ import io.flutter.plugin.common.MessageCodec; import io.flutter.plugin.common.StandardMessageCodec; import java.io.ByteArrayOutputStream; -import java.lang.annotation.Retention; -import java.lang.annotation.Target; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Arrays; @@ -70,10 +65,6 @@ protected static FlutterError createConnectionError(@NonNull String channelName) "channel-error", "Unable to establish connection on channel: " + channelName + ".", ""); } - @Target(METHOD) - @Retention(CLASS) - @interface CanIgnoreReturnValue {} - public enum AnEnum { ONE(0), TWO(1), @@ -268,7 +259,6 @@ public static final class Builder { private @Nullable Boolean aBool; - @CanIgnoreReturnValue public @NonNull Builder setABool(@NonNull Boolean setterArg) { this.aBool = setterArg; return this; @@ -276,7 +266,6 @@ public static final class Builder { private @Nullable Long anInt; - @CanIgnoreReturnValue public @NonNull Builder setAnInt(@NonNull Long setterArg) { this.anInt = setterArg; return this; @@ -284,7 +273,6 @@ public static final class Builder { private @Nullable Long anInt64; - @CanIgnoreReturnValue public @NonNull Builder setAnInt64(@NonNull Long setterArg) { this.anInt64 = setterArg; return this; @@ -292,7 +280,6 @@ public static final class Builder { private @Nullable Double aDouble; - @CanIgnoreReturnValue public @NonNull Builder setADouble(@NonNull Double setterArg) { this.aDouble = setterArg; return this; @@ -300,7 +287,6 @@ public static final class Builder { private @Nullable byte[] aByteArray; - @CanIgnoreReturnValue public @NonNull Builder setAByteArray(@NonNull byte[] setterArg) { this.aByteArray = setterArg; return this; @@ -308,7 +294,6 @@ public static final class Builder { private @Nullable int[] a4ByteArray; - @CanIgnoreReturnValue public @NonNull Builder setA4ByteArray(@NonNull int[] setterArg) { this.a4ByteArray = setterArg; return this; @@ -316,7 +301,6 @@ public static final class Builder { private @Nullable long[] a8ByteArray; - @CanIgnoreReturnValue public @NonNull Builder setA8ByteArray(@NonNull long[] setterArg) { this.a8ByteArray = setterArg; return this; @@ -324,7 +308,6 @@ public static final class Builder { private @Nullable double[] aFloatArray; - @CanIgnoreReturnValue public @NonNull Builder setAFloatArray(@NonNull double[] setterArg) { this.aFloatArray = setterArg; return this; @@ -332,7 +315,6 @@ public static final class Builder { private @Nullable List aList; - @CanIgnoreReturnValue public @NonNull Builder setAList(@NonNull List setterArg) { this.aList = setterArg; return this; @@ -340,7 +322,6 @@ public static final class Builder { private @Nullable Map aMap; - @CanIgnoreReturnValue public @NonNull Builder setAMap(@NonNull Map setterArg) { this.aMap = setterArg; return this; @@ -348,7 +329,6 @@ public static final class Builder { private @Nullable AnEnum anEnum; - @CanIgnoreReturnValue public @NonNull Builder setAnEnum(@NonNull AnEnum setterArg) { this.anEnum = setterArg; return this; @@ -356,7 +336,6 @@ public static final class Builder { private @Nullable String aString; - @CanIgnoreReturnValue public @NonNull Builder setAString(@NonNull String setterArg) { this.aString = setterArg; return this; @@ -364,7 +343,6 @@ public static final class Builder { private @Nullable Object anObject; - @CanIgnoreReturnValue public @NonNull Builder setAnObject(@NonNull Object setterArg) { this.anObject = setterArg; return this; @@ -614,7 +592,6 @@ public static final class Builder { private @Nullable Boolean aNullableBool; - @CanIgnoreReturnValue public @NonNull Builder setANullableBool(@Nullable Boolean setterArg) { this.aNullableBool = setterArg; return this; @@ -622,7 +599,6 @@ public static final class Builder { private @Nullable Long aNullableInt; - @CanIgnoreReturnValue public @NonNull Builder setANullableInt(@Nullable Long setterArg) { this.aNullableInt = setterArg; return this; @@ -630,7 +606,6 @@ public static final class Builder { private @Nullable Long aNullableInt64; - @CanIgnoreReturnValue public @NonNull Builder setANullableInt64(@Nullable Long setterArg) { this.aNullableInt64 = setterArg; return this; @@ -638,7 +613,6 @@ public static final class Builder { private @Nullable Double aNullableDouble; - @CanIgnoreReturnValue public @NonNull Builder setANullableDouble(@Nullable Double setterArg) { this.aNullableDouble = setterArg; return this; @@ -646,7 +620,6 @@ public static final class Builder { private @Nullable byte[] aNullableByteArray; - @CanIgnoreReturnValue public @NonNull Builder setANullableByteArray(@Nullable byte[] setterArg) { this.aNullableByteArray = setterArg; return this; @@ -654,7 +627,6 @@ public static final class Builder { private @Nullable int[] aNullable4ByteArray; - @CanIgnoreReturnValue public @NonNull Builder setANullable4ByteArray(@Nullable int[] setterArg) { this.aNullable4ByteArray = setterArg; return this; @@ -662,7 +634,6 @@ public static final class Builder { private @Nullable long[] aNullable8ByteArray; - @CanIgnoreReturnValue public @NonNull Builder setANullable8ByteArray(@Nullable long[] setterArg) { this.aNullable8ByteArray = setterArg; return this; @@ -670,7 +641,6 @@ public static final class Builder { private @Nullable double[] aNullableFloatArray; - @CanIgnoreReturnValue public @NonNull Builder setANullableFloatArray(@Nullable double[] setterArg) { this.aNullableFloatArray = setterArg; return this; @@ -678,7 +648,6 @@ public static final class Builder { private @Nullable List aNullableList; - @CanIgnoreReturnValue public @NonNull Builder setANullableList(@Nullable List setterArg) { this.aNullableList = setterArg; return this; @@ -686,7 +655,6 @@ public static final class Builder { private @Nullable Map aNullableMap; - @CanIgnoreReturnValue public @NonNull Builder setANullableMap(@Nullable Map setterArg) { this.aNullableMap = setterArg; return this; @@ -694,7 +662,6 @@ public static final class Builder { private @Nullable List> nullableNestedList; - @CanIgnoreReturnValue public @NonNull Builder setNullableNestedList(@Nullable List> setterArg) { this.nullableNestedList = setterArg; return this; @@ -702,7 +669,6 @@ public static final class Builder { private @Nullable Map nullableMapWithAnnotations; - @CanIgnoreReturnValue public @NonNull Builder setNullableMapWithAnnotations( @Nullable Map setterArg) { this.nullableMapWithAnnotations = setterArg; @@ -711,7 +677,6 @@ public static final class Builder { private @Nullable Map nullableMapWithObject; - @CanIgnoreReturnValue public @NonNull Builder setNullableMapWithObject(@Nullable Map setterArg) { this.nullableMapWithObject = setterArg; return this; @@ -719,7 +684,6 @@ public static final class Builder { private @Nullable AnEnum aNullableEnum; - @CanIgnoreReturnValue public @NonNull Builder setANullableEnum(@Nullable AnEnum setterArg) { this.aNullableEnum = setterArg; return this; @@ -727,7 +691,6 @@ public static final class Builder { private @Nullable String aNullableString; - @CanIgnoreReturnValue public @NonNull Builder setANullableString(@Nullable String setterArg) { this.aNullableString = setterArg; return this; @@ -735,7 +698,6 @@ public static final class Builder { private @Nullable Object aNullableObject; - @CanIgnoreReturnValue public @NonNull Builder setANullableObject(@Nullable Object setterArg) { this.aNullableObject = setterArg; return this; @@ -872,7 +834,6 @@ public static final class Builder { private @Nullable AllNullableTypes allNullableTypes; - @CanIgnoreReturnValue public @NonNull Builder setAllNullableTypes(@NonNull AllNullableTypes setterArg) { this.allNullableTypes = setterArg; return this; @@ -880,7 +841,6 @@ public static final class Builder { private @Nullable AllTypes allTypes; - @CanIgnoreReturnValue public @NonNull Builder setAllTypes(@Nullable AllTypes setterArg) { this.allTypes = setterArg; return this; @@ -936,7 +896,6 @@ public static final class Builder { private @Nullable List testList; - @CanIgnoreReturnValue public @NonNull Builder setTestList(@Nullable List setterArg) { this.testList = setterArg; return this; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/pubspec.yaml b/packages/pigeon/platform_tests/shared_test_plugin_code/pubspec.yaml index eede4a71dd25..edd443f339b6 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/pubspec.yaml +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/pubspec.yaml @@ -18,4 +18,4 @@ dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 diff --git a/packages/pigeon/platform_tests/test_plugin/android/build.gradle b/packages/pigeon/platform_tests/test_plugin/android/build.gradle index 397013c731ee..263a4fec6302 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/build.gradle +++ b/packages/pigeon/platform_tests/test_plugin/android/build.gradle @@ -2,7 +2,7 @@ group 'com.example.test_plugin' version '1.0-SNAPSHOT' buildscript { - ext.kotlin_version = '1.9.21' + ext.kotlin_version = '1.9.20' repositories { google() mavenCentral() diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt index 798d66849895..e1c371cf1e0b 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt @@ -20,7 +20,7 @@ private fun wrapResult(result: Any?): List { } private fun wrapError(exception: Throwable): List { - if (exception is CoreTestsError) { + if (exception is FlutterError) { return listOf(exception.code, exception.message, exception.details) } else { return listOf( @@ -30,8 +30,8 @@ private fun wrapError(exception: Throwable): List { } } -private fun createConnectionError(channelName: String): CoreTestsError { - return CoreTestsError( +private fun createConnectionError(channelName: String): FlutterError { + return FlutterError( "channel-error", "Unable to establish connection on channel: '$channelName'.", "") } @@ -42,7 +42,7 @@ private fun createConnectionError(channelName: String): CoreTestsError { * @property message The error message. * @property details The error details. Must be a datatype supported by the api codec. */ -class CoreTestsError( +class FlutterError( val code: String, override val message: String? = null, val details: Any? = null @@ -2397,8 +2397,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(null) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } @@ -2415,8 +2414,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(null) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] callback(Result.success(output)) @@ -2434,8 +2432,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(null) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } @@ -2452,12 +2449,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(everythingArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2481,8 +2477,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(everythingArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as AllNullableTypes? callback(Result.success(output)) @@ -2509,12 +2504,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aNullableBoolArg, aNullableIntArg, aNullableStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2535,12 +2529,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aBoolArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2561,12 +2554,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(anIntArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2587,12 +2579,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aDoubleArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2613,12 +2604,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2639,12 +2629,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2665,12 +2654,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2691,12 +2679,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aMapArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2717,12 +2704,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(anEnumArg.raw)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -2743,8 +2729,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aBoolArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Boolean? callback(Result.success(output)) @@ -2762,8 +2747,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(anIntArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0].let { if (it is Int) it.toLong() else it as Long? } callback(Result.success(output)) @@ -2781,8 +2765,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aDoubleArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Double? callback(Result.success(output)) @@ -2800,8 +2783,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as String? callback(Result.success(output)) @@ -2819,8 +2801,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as ByteArray? callback(Result.success(output)) @@ -2838,8 +2819,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aListArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as List? callback(Result.success(output)) @@ -2860,8 +2840,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aMapArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = it[0] as Map? callback(Result.success(output)) @@ -2879,8 +2858,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(anEnumArg?.raw)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { val output = (it[0] as Int?)?.let { AnEnum.ofRaw(it) } callback(Result.success(output)) @@ -2901,8 +2879,7 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(null) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { callback(Result.success(Unit)) } @@ -2919,12 +2896,11 @@ class FlutterIntegrationCoreApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -3081,12 +3057,11 @@ class FlutterSmallApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(msgArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) @@ -3106,12 +3081,11 @@ class FlutterSmallApi(private val binaryMessenger: BinaryMessenger) { channel.send(listOf(aStringArg)) { if (it is List<*>) { if (it.size > 1) { - callback( - Result.failure(CoreTestsError(it[0] as String, it[1] as String, it[2] as String?))) + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else if (it[0] == null) { callback( Result.failure( - CoreTestsError( + FlutterError( "null-error", "Flutter api returned null value for non-null return value.", ""))) diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt index c14f7129e40d..8b4e8bc4fb18 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt @@ -39,7 +39,7 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { } override fun throwFlutterError(): Any? { - throw CoreTestsError("code", "message", "details") + throw FlutterError("code", "message", "details") } override fun echoInt(anInt: Long): Long { @@ -170,7 +170,7 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { } override fun throwAsyncFlutterError(callback: (Result) -> Unit) { - callback(Result.failure(CoreTestsError("code", "message", "details"))) + callback(Result.failure(FlutterError("code", "message", "details"))) } override fun echoAsyncAllTypes(everything: AllTypes, callback: (Result) -> Unit) { diff --git a/packages/pigeon/platform_tests/test_plugin/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/pigeon/platform_tests/test_plugin/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/pigeon/platform_tests/test_plugin/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index 67f7fa73e691..dcb9487727dd 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -1,8 +1,8 @@ name: pigeon description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. repository: https://github.com/flutter/packages/tree/main/packages/pigeon -issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22 -version: 15.0.2 # This must match the version in lib/generator_tools.dart +issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apigeon +version: 14.0.0 # This must match the version in lib/generator_tools.dart environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/pigeon/test/dart_generator_test.dart b/packages/pigeon/test/dart_generator_test.dart index 83a6556c7fab..2ab5f3f8df08 100644 --- a/packages/pigeon/test/dart_generator_test.dart +++ b/packages/pigeon/test/dart_generator_test.dart @@ -1417,41 +1417,6 @@ void main() { expect(code, contains('void doit(int? foo);')); }); - test('named argument flutter', () { - final Root root = Root( - apis: [ - Api(name: 'Api', location: ApiLocation.flutter, methods: [ - Method( - name: 'doit', - returnType: const TypeDeclaration.voidDeclaration(), - parameters: [ - Parameter( - name: 'foo', - type: const TypeDeclaration( - baseName: 'int', - isNullable: false, - ), - isNamed: true, - isPositional: false), - ]) - ]) - ], - classes: [], - enums: [], - ); - final StringBuffer sink = StringBuffer(); - const DartGenerator generator = DartGenerator(); - generator.generate( - const DartOptions(), - root, - sink, - dartPackageName: DEFAULT_PACKAGE_NAME, - ); - final String code = sink.toString(); - expect(code, contains('void doit({required int foo});')); - expect(code, contains('api.doit(foo: arg_foo!)')); - }); - test('uses output package name for imports', () { const String overriddenPackageName = 'custom_name'; const String outputPackageName = 'some_output_package'; diff --git a/packages/pigeon/test/java_generator_test.dart b/packages/pigeon/test/java_generator_test.dart index 1cae5f664a55..99936ca2b925 100644 --- a/packages/pigeon/test/java_generator_test.dart +++ b/packages/pigeon/test/java_generator_test.dart @@ -53,7 +53,6 @@ void main() { expect(code, contains('public static final class Foobar')); expect(code, contains('public static final class Builder')); expect(code, contains('private @Nullable Long field1;')); - expect(code, contains('@CanIgnoreReturnValue')); }); test('gen one enum', () { diff --git a/packages/pigeon/test/kotlin_generator_test.dart b/packages/pigeon/test/kotlin_generator_test.dart index f51c68b32bcc..606f47e3690f 100644 --- a/packages/pigeon/test/kotlin_generator_test.dart +++ b/packages/pigeon/test/kotlin_generator_test.dart @@ -1635,166 +1635,4 @@ void main() { contains( 'callback(Result.failure(createConnectionError(channelName)))')); }); - - test('gen host uses default error class', () { - final Root root = Root( - apis: [ - Api( - name: 'Api', - location: ApiLocation.host, - methods: [ - Method( - name: 'method', - returnType: const TypeDeclaration.voidDeclaration(), - parameters: [ - Parameter( - name: 'field', - type: const TypeDeclaration( - baseName: 'int', - isNullable: true, - ), - ), - ], - ) - ], - ) - ], - classes: [], - enums: [], - ); - final StringBuffer sink = StringBuffer(); - const KotlinOptions kotlinOptions = KotlinOptions(); - const KotlinGenerator generator = KotlinGenerator(); - generator.generate( - kotlinOptions, - root, - sink, - dartPackageName: DEFAULT_PACKAGE_NAME, - ); - final String code = sink.toString(); - expect(code, contains('FlutterError')); - }); - - test('gen flutter uses default error class', () { - final Root root = Root( - apis: [ - Api( - name: 'Api', - location: ApiLocation.flutter, - methods: [ - Method( - name: 'method', - returnType: const TypeDeclaration.voidDeclaration(), - parameters: [ - Parameter( - name: 'field', - type: const TypeDeclaration( - baseName: 'int', - isNullable: true, - ), - ), - ], - ) - ], - ) - ], - classes: [], - enums: [], - ); - final StringBuffer sink = StringBuffer(); - const KotlinOptions kotlinOptions = KotlinOptions(); - const KotlinGenerator generator = KotlinGenerator(); - generator.generate( - kotlinOptions, - root, - sink, - dartPackageName: DEFAULT_PACKAGE_NAME, - ); - final String code = sink.toString(); - expect(code, contains('FlutterError')); - }); - - test('gen host uses error class', () { - final Root root = Root( - apis: [ - Api( - name: 'Api', - location: ApiLocation.host, - methods: [ - Method( - name: 'method', - returnType: const TypeDeclaration.voidDeclaration(), - parameters: [ - Parameter( - name: 'field', - type: const TypeDeclaration( - baseName: 'int', - isNullable: true, - ), - ), - ], - ) - ], - ) - ], - classes: [], - enums: [], - ); - final StringBuffer sink = StringBuffer(); - const String errorClassName = 'FooError'; - const KotlinOptions kotlinOptions = - KotlinOptions(errorClassName: errorClassName); - const KotlinGenerator generator = KotlinGenerator(); - generator.generate( - kotlinOptions, - root, - sink, - dartPackageName: DEFAULT_PACKAGE_NAME, - ); - final String code = sink.toString(); - expect(code, contains(errorClassName)); - expect(code, isNot(contains('FlutterError'))); - }); - - test('gen flutter uses error class', () { - final Root root = Root( - apis: [ - Api( - name: 'Api', - location: ApiLocation.flutter, - methods: [ - Method( - name: 'method', - returnType: const TypeDeclaration.voidDeclaration(), - parameters: [ - Parameter( - name: 'field', - type: const TypeDeclaration( - baseName: 'int', - isNullable: true, - ), - ), - ], - ) - ], - ) - ], - classes: [], - enums: [], - ); - final StringBuffer sink = StringBuffer(); - const String errorClassName = 'FooError'; - const KotlinOptions kotlinOptions = - KotlinOptions(errorClassName: errorClassName); - const KotlinGenerator generator = KotlinGenerator(); - generator.generate( - kotlinOptions, - root, - sink, - dartPackageName: DEFAULT_PACKAGE_NAME, - ); - final String code = sink.toString(); - expect(code, contains(errorClassName)); - expect(code, isNot(contains('FlutterError'))); - }); } diff --git a/packages/pigeon/test/pigeon_lib_test.dart b/packages/pigeon/test/pigeon_lib_test.dart index 5d60f92bf69d..dc0f6061e37f 100644 --- a/packages/pigeon/test/pigeon_lib_test.dart +++ b/packages/pigeon/test/pigeon_lib_test.dart @@ -1324,32 +1324,4 @@ abstract class Api { }); await completer.future; }); - - test('unsupported non-positional parameters on FlutterApi', () { - const String code = ''' -@FlutterApi() -abstract class Api { - int? calc({int? anInt}); -} -'''; - - final ParseResults results = parseSource(code); - expect(results.errors.length, 1); - expect(results.errors[0].message, - contains('FlutterApi method parameters must be positional')); - }); - - test('unsupported optional parameters on FlutterApi', () { - const String code = ''' -@FlutterApi() -abstract class Api { - int? calc([int? anInt]); -} -'''; - - final ParseResults results = parseSource(code); - expect(results.errors.length, 1); - expect(results.errors[0].message, - contains('FlutterApi method parameters must not be optional')); - }); } diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index 1ae5a45edc3e..de03c3c94245 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -89,7 +89,8 @@ Future generateTestPigeons({required String baseDir}) async { ? null : '$outputBase/android/src/main/kotlin/com/example/test_plugin/$pascalCaseName.gen.kt', kotlinPackage: 'com.example.test_plugin', - kotlinErrorClassName: '${pascalCaseName}Error', + kotlinErrorClassName: + input == 'core_tests' ? null : '${pascalCaseName}Error', // iOS swiftOut: skipLanguages.contains(GeneratorLanguages.swift) ? null @@ -245,6 +246,5 @@ Future formatAllFiles({required String repositoryRoot}) { '--packages=pigeon', ], workingDirectory: repositoryRoot, - streamOutput: false, logFailure: true); } diff --git a/packages/pigeon/tool/shared/process_utils.dart b/packages/pigeon/tool/shared/process_utils.dart index 28c816f18b1b..a6a904b945fd 100644 --- a/packages/pigeon/tool/shared/process_utils.dart +++ b/packages/pigeon/tool/shared/process_utils.dart @@ -3,19 +3,27 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:io' show Process, ProcessStartMode, stderr, stdout; +import 'dart:io' show Process, stderr, stdout; + +Future _streamOutput(Future processFuture) async { + final Process process = await processFuture; + await Future.wait(>[ + stdout.addStream(process.stdout), + stderr.addStream(process.stderr), + ]); + return process; +} Future runProcess(String command, List arguments, {String? workingDirectory, bool streamOutput = true, bool logFailure = false}) async { - final Process process = await Process.start( + final Future future = Process.start( command, arguments, workingDirectory: workingDirectory, - mode: - streamOutput ? ProcessStartMode.inheritStdio : ProcessStartMode.normal, ); + final Process process = await (streamOutput ? _streamOutput(future) : future); final int exitCode = await process.exitCode; if (exitCode != 0 && logFailure) { // ignore: avoid_print diff --git a/packages/platform/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/platform/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..3c472b99c6f3 100644 --- a/packages/platform/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/platform/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/plugin_platform_interface/pubspec.yaml b/packages/plugin_platform_interface/pubspec.yaml index 549b148afd29..9c83848759ed 100644 --- a/packages/plugin_platform_interface/pubspec.yaml +++ b/packages/plugin_platform_interface/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: meta: ^1.3.0 dev_dependencies: - mockito: 5.4.3 + mockito: 5.4.1 test: ^1.16.0 topics: diff --git a/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md index 5c65bae804aa..b6d9709b6f05 100644 --- a/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md +++ b/packages/pointer_interceptor/pointer_interceptor/CHANGELOG.md @@ -1,11 +1,6 @@ -## 0.10.0 - -* Transitions to federated architecture. -* Adds iOS implementation to federated package. - ## 0.9.3+7 -* Updates metadata to point to new source folder. +* Updates metadata to point to new source folder ## 0.9.3+6 diff --git a/packages/pointer_interceptor/pointer_interceptor/README.md b/packages/pointer_interceptor/pointer_interceptor/README.md index ed1a37c1102f..6da163fc5d1a 100644 --- a/packages/pointer_interceptor/pointer_interceptor/README.md +++ b/packages/pointer_interceptor/pointer_interceptor/README.md @@ -1,25 +1,24 @@ # pointer_interceptor -| | iOS | Web | -|-------------|---------|-----| -| **Support** | iOS 11+ | Any | +`PointerInterceptor` is a widget that prevents mouse events (in web) from being captured by an underlying [`HtmlElementView`](https://api.flutter.dev/flutter/widgets/HtmlElementView-class.html). -`PointerInterceptor` is a widget that prevents mouse events from being captured by an underlying [`HtmlElementView`](https://api.flutter.dev/flutter/widgets/HtmlElementView-class.html) in web, or an underlying [`PlatformView`](https://api.flutter.dev/flutter/widgets/PlatformViewLink-class.html) on iOS. +You can use this widget in a cross-platform app freely. In mobile, where the issue that this plugin fixes does not exist, the widget acts as a pass-through of its `children`, without adding anything to the render tree. ## What is the problem? -When overlaying Flutter widgets on top of `HtmlElementView`/`PlatformView` widgets that respond to mouse gestures (handle clicks, for example), the clicks will be consumed by the `HtmlElementView`/`PlatformView`, and not relayed to Flutter. +When overlaying Flutter widgets on top of `HtmlElementView` widgets that respond to mouse gestures (handle clicks, for example), the clicks will be consumed by the `HtmlElementView`, and not relayed to Flutter. -The result is that Flutter widget's `onTap` (and other) handlers won't fire as expected, but they'll affect the underlying native platform view. +The result is that Flutter widget's `onTap` (and other) handlers won't fire as expected, but they'll affect the underlying webview. |The problem...| |:-:| -|![Depiction of problematic areas](https://raw.githubusercontent.com/flutter/packages/cb6dbcdd230528c0c246c81d93386c512f9a23d0/packages/pointer_interceptor/pointer_interceptor/doc/img/affected-areas.png)| +|![Depiction of problematic areas](https://raw.githubusercontent.com/flutter/packages/main/packages/pointer_interceptor/doc/img/affected-areas.png)| |_In the dashed areas, mouse events won't work as expected. The `HtmlElementView` will consume them before Flutter sees them._| + ## How does this work? -In web, `PointerInterceptor` creates a platform view consisting of an empty HTML element, while on iOS it creates an empty `UIView` instead. The element has the size of its `child` widget, and is inserted in the layer tree _behind_ its child in paint order. +`PointerInterceptor` creates a platform view consisting of an empty HTML element. The element has the size of its `child` widget, and is inserted in the layer tree _behind_ its child in paint order. This empty platform view doesn't do anything with mouse events, other than preventing them from reaching other platform views underneath it. @@ -27,7 +26,7 @@ This gives an opportunity to the Flutter framework to handle the click, as expec |The solution...| |:-:| -|![Depiction of the solution](https://raw.githubusercontent.com/flutter/packages/cb6dbcdd230528c0c246c81d93386c512f9a23d0/packages/pointer_interceptor/pointer_interceptor/doc/img/fixed-areas.png)| +|![Depiction of the solution](https://raw.githubusercontent.com/flutter/packages/main/packages/pointer_interceptor/doc/img/fixed-areas.png)| |_Each `PointerInterceptor` (green) renders between Flutter widgets and the underlying `HtmlElementView`. Mouse events now can't reach the background HtmlElementView, and work as expected._| ## How to use diff --git a/packages/pointer_interceptor/pointer_interceptor/example/.gitignore b/packages/pointer_interceptor/pointer_interceptor/example/.gitignore index a1345d017cf7..0fa6b675c0a5 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/.gitignore +++ b/packages/pointer_interceptor/pointer_interceptor/example/.gitignore @@ -32,6 +32,7 @@ /build/ # Web related +lib/generated_plugin_registrant.dart # Symbolication related app.*.symbols diff --git a/packages/pointer_interceptor/pointer_interceptor/example/.metadata b/packages/pointer_interceptor/pointer_interceptor/example/.metadata index 45df7cb6cc4d..d2885b8e359e 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/.metadata +++ b/packages/pointer_interceptor/pointer_interceptor/example/.metadata @@ -4,27 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "969911d1d09d6c4f145e9ce27c08093e8c285561" - channel: "main" + revision: e6bd95bc5caa5e34c5b0285a559673984374b7ea + channel: master project_type: app - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 - base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 - - platform: ios - create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 - base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/pointer_interceptor/pointer_interceptor/example/integration_test/widget_test.dart b/packages/pointer_interceptor/pointer_interceptor/example/integration_test/widget_test.dart index 4d35073287d4..c8d5d6f52b74 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/integration_test/widget_test.dart +++ b/packages/pointer_interceptor/pointer_interceptor/example/integration_test/widget_test.dart @@ -4,13 +4,176 @@ // ignore_for_file: avoid_print +import 'dart:html' as html; + +// Imports the Flutter Driver API. +import 'package:flutter/src/widgets/framework.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; +import 'package:pointer_interceptor_example/main.dart' as app; + +final Finder nonClickableButtonFinder = + find.byKey(const Key('transparent-button')); +final Finder clickableWrappedButtonFinder = + find.byKey(const Key('wrapped-transparent-button')); +final Finder clickableButtonFinder = find.byKey(const Key('clickable-button')); +final Finder backgroundFinder = + find.byKey(const ValueKey('background-widget')); + void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - // TODO(louisehsu): given the difficulty of making the same integration tests - // work for both web and ios implementations, please find tests in their respective - // platform implementation packages. - testWidgets('placeholder test', (WidgetTester tester) async {}); + + group('Without semantics', () { + testWidgets( + 'on wrapped elements, the browser does not hit the background-html-view', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAtCenter(clickableButtonFinder, tester); + + expect(element.id, isNot('background-html-view')); + }, semanticsEnabled: false); + + testWidgets( + 'on wrapped elements with intercepting set to false, the browser hits the background-html-view', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAtCenter(clickableWrappedButtonFinder, tester); + + expect(element.id, 'background-html-view'); + }, semanticsEnabled: false); + + testWidgets( + 'on unwrapped elements, the browser hits the background-html-view', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAtCenter(nonClickableButtonFinder, tester); + + expect(element.id, 'background-html-view'); + }, semanticsEnabled: false); + + testWidgets('on background directly', (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAt(tester.getTopLeft(backgroundFinder)); + + expect(element.id, 'background-html-view'); + }, semanticsEnabled: false); + }); + + group('With semantics', () { + testWidgets('finds semantics of wrapped widgets', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + if (!_newSemanticsAvailable()) { + print('Skipping test: Needs flutter > 2.10'); + return; + } + + final html.Element element = + _getHtmlElementAtCenter(clickableButtonFinder, tester); + + expect(element.tagName.toLowerCase(), 'flt-semantics'); + expect(element.getAttribute('aria-label'), 'Works As Expected'); + }); + + testWidgets( + 'finds semantics of wrapped widgets with intercepting set to false', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + if (!_newSemanticsAvailable()) { + print('Skipping test: Needs flutter > 2.10'); + return; + } + + final html.Element element = + _getHtmlElementAtCenter(clickableWrappedButtonFinder, tester); + + expect(element.tagName.toLowerCase(), 'flt-semantics'); + expect(element.getAttribute('aria-label'), + 'Never calls onPressed transparent'); + }); + + testWidgets('finds semantics of unwrapped elements', + (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + if (!_newSemanticsAvailable()) { + print('Skipping test: Needs flutter > 2.10'); + return; + } + + final html.Element element = + _getHtmlElementAtCenter(nonClickableButtonFinder, tester); + + expect(element.tagName.toLowerCase(), 'flt-semantics'); + expect(element.getAttribute('aria-label'), 'Never calls onPressed'); + }); + + // Notice that, when hit-testing the background platform view, instead of + // finding a semantics node, the platform view itself is found. This is + // because the platform view does not add interactive semantics nodes into + // the framework's semantics tree. Instead, its semantics is determined by + // the HTML content of the platform view itself. Flutter's semantics tree + // simply allows the hit test to land on the platform view by making itself + // hit test transparent. + testWidgets('on background directly', (WidgetTester tester) async { + app.main(); + await tester.pumpAndSettle(); + + final html.Element element = + _getHtmlElementAt(tester.getTopLeft(backgroundFinder)); + + expect(element.id, 'background-html-view'); + }); + }); +} + +// Calls [_getHtmlElementAt] passing it the center of the widget identified by +// the `finder`. +html.Element _getHtmlElementAtCenter(Finder finder, WidgetTester tester) { + final Offset point = tester.getCenter(finder); + return _getHtmlElementAt(point); +} + +// Locates the DOM element at the given `point` using `elementFromPoint`. +// +// `elementFromPoint` is an approximate proxy for a hit test, although it's +// sensitive to the presence of shadow roots and browser quirks (not all +// browsers agree on what it should return in all situations). Since this test +// runs only in Chromium, it relies on Chromium's behavior. +html.Element _getHtmlElementAt(Offset point) { + // Probe at the shadow so the browser reports semantics nodes in addition to + // platform view elements. If probed from `html.document` the browser hides + // the contents of as an implementation detail. + final html.ShadowRoot glassPaneShadow = + html.document.querySelector('flt-glass-pane')!.shadowRoot!; + return glassPaneShadow.elementFromPoint(point.dx.toInt(), point.dy.toInt())!; +} + +// TODO(dit): Remove this after flutter master (2.13) lands into stable. +// This detects that we can do new semantics assertions by looking at the 'id' +// attribute on flt-semantics elements (it is now set in 2.13 and up). +bool _newSemanticsAvailable() { + final html.ShadowRoot glassPaneShadow = + html.document.querySelector('flt-glass-pane')!.shadowRoot!; + final List elements = + glassPaneShadow.querySelectorAll('flt-semantics[id]'); + return elements.isNotEmpty; } diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/.gitignore b/packages/pointer_interceptor/pointer_interceptor/example/ios/.gitignore deleted file mode 100644 index 7a7f9873ad7d..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/AppFrameworkInfo.plist b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 9625e105df39..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 11.0 - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Debug.xcconfig b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index ec97fc6f3021..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Release.xcconfig b/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index c4855bfe2000..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Podfile b/packages/pointer_interceptor/pointer_interceptor/example/ios/Podfile deleted file mode 100644 index 88359b225fa1..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Podfile +++ /dev/null @@ -1,41 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '11.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.pbxproj b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index c0b3e74c2e16..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,559 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - F25BFF892B037A720088B2C7 /* DummyPlatformViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F25BFF882B037A6C0088B2C7 /* DummyPlatformViewFactory.swift */; }; - F7B3FF2A19BF60DCE2927CCE /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = ABC6D95C6CA2BCA05B3C28FD /* Pods_Runner.framework */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 095E300DCC1C42BD0A014AAC /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 53AC91685EB02A84FAE15CFA /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - ABC6D95C6CA2BCA05B3C28FD /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - EBBA6242570F249EF7490E9D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - F25BFF882B037A6C0088B2C7 /* DummyPlatformViewFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DummyPlatformViewFactory.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - F7B3FF2A19BF60DCE2927CCE /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 1C9A5A1A7487CB72068132AF /* Pods */ = { - isa = PBXGroup; - children = ( - EBBA6242570F249EF7490E9D /* Pods-Runner.debug.xcconfig */, - 095E300DCC1C42BD0A014AAC /* Pods-Runner.release.xcconfig */, - 53AC91685EB02A84FAE15CFA /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - 1C9A5A1A7487CB72068132AF /* Pods */, - FC5EF6E923E6BF75C542BDC7 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - F25BFF882B037A6C0088B2C7 /* DummyPlatformViewFactory.swift */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - FC5EF6E923E6BF75C542BDC7 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ABC6D95C6CA2BCA05B3C28FD /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 4B32A7E5952A8E40E6FE6E6C /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - D271A2AAEBA84769C4A17920 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastUpgradeCheck = 1430; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 4B32A7E5952A8E40E6FE6E6C /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - D271A2AAEBA84769C4A17920 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F25BFF892B037A720088B2C7 /* DummyPlatformViewFactory.swift in Sources */, - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = PZ83UV676J; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.pointerinterceptorios; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = PZ83UV676J; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.example; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = PZ83UV676J; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = com.example.example; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5ea15..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 87131a09bea5..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,98 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5ea15..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift deleted file mode 100644 index 41be7b255972..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - - weak var registrar = self.registrar(forPlugin: "DummyPlatform"); - - let factory = DummyPlatformViewFactory(messenger: registrar!.messenger()) - self.registrar(forPlugin: "")!.register( - factory, - withId: "dummy_platform_view") - - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4725e9..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 7353c41ecf9c..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 797d452e4589..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index 6ed2d933e112..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cd7b0099ca8..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index fe730945a01f..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index 321773cd857a..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 797d452e4589..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index 502f463a9bc8..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index 0ec303439225..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index 0ec303439225..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index e9f5fea27c70..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index 84ac32ae7d98..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 8953cba09064..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index 0467bf12aa4d..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/Main.storyboard b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c28516fb38..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift deleted file mode 100644 index 5ea634fa9226..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/DummyPlatformViewFactory.swift +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Flutter -import UIKit - -/** - * A simple factory that creates a dummy platform view for testing. - */ -public class DummyPlatformViewFactory: NSObject, FlutterPlatformViewFactory { - private var messenger: FlutterBinaryMessenger - - init(messenger: FlutterBinaryMessenger) { - self.messenger = messenger - super.init() - } - - public func create( - withFrame frame: CGRect, - viewIdentifier viewId: Int64, - arguments args: Any? - ) -> FlutterPlatformView { - return DummyPlatformView( - frame: frame, - viewIdentifier: viewId, - arguments: args, - binaryMessenger: messenger) - } - - public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { - return FlutterStandardMessageCodec.sharedInstance() - } -} - -/** - * A native view that will remove it's tag if clicked. - */ -public class CustomView: UIView { - - var timesClicked = 0; - var nativeLabel = UILabel() - - override public func hitTest( - _ point: CGPoint, - with event: UIEvent? - ) -> UIView? { - if (viewWithTag(1) != nil) { - viewWithTag(1)?.removeFromSuperview(); - createNativeView(view: self); - } - timesClicked += 1; - nativeLabel.text = "Traversed \(timesClicked) subviews" - return super.hitTest(point, with: event) - } - - func createNativeView(view _view: CustomView){ - nativeLabel.text = "Traversed \(timesClicked) subviews" - nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) - _view.addSubview(nativeLabel) - } -} -/** - * A flutter platform view that displays a simple native view. - */ -class DummyPlatformView: NSObject, FlutterPlatformView { - private var _view: CustomView; - - init( - frame: CGRect, - viewIdentifier viewId: Int64, - arguments args: Any?, - binaryMessenger messenger: FlutterBinaryMessenger? - ) { - _view = CustomView() - super.init() - createNativeView(view: _view) - } - - func view() -> UIView { - return _view - } - - func createNativeView(view _view: CustomView){ - let nativeLabel = UILabel() - nativeLabel.tag = 1; - nativeLabel.text = "Native View Not Clicked" - nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) - _view.addSubview(nativeLabel) - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Info.plist b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Info.plist deleted file mode 100644 index f15383a8587d..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CADisableMinimumFrameDurationOnPhone - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Example - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UIApplicationSupportsIndirectInputEvents - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Runner-Bridging-Header.h b/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index eb7e8ba8052f..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "GeneratedPluginRegistrant.h" diff --git a/packages/pointer_interceptor/pointer_interceptor/example/lib/main.dart b/packages/pointer_interceptor/pointer_interceptor/example/lib/main.dart index f62f5ad5ea06..74f632a60236 100644 --- a/packages/pointer_interceptor/pointer_interceptor/example/lib/main.dart +++ b/packages/pointer_interceptor/pointer_interceptor/example/lib/main.dart @@ -3,15 +3,49 @@ // found in the LICENSE file. // ignore: avoid_web_libraries_in_flutter +import 'dart:html' as html; +import 'dart:ui_web' as ui_web; import 'package:flutter/material.dart'; import 'package:pointer_interceptor/pointer_interceptor.dart'; -import 'native_widget.dart'; +const String _htmlElementViewType = '_htmlElementViewType'; const double _videoWidth = 640; const double _videoHeight = 480; +/// The html.Element that will be rendered underneath the flutter UI. +html.Element htmlElement = html.DivElement() + ..style.width = '100%' + ..style.height = '100%' + ..style.backgroundColor = '#fabada' + ..style.cursor = 'auto' + ..id = 'background-html-view'; + +// See other examples commented out below... + +// html.Element htmlElement = html.VideoElement() +// ..style.width = '100%' +// ..style.height = '100%' +// ..style.cursor = 'auto' +// ..style.backgroundColor = 'black' +// ..id = 'background-html-view' +// ..src = 'https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4' +// ..poster = 'https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217' +// ..controls = true; + +// html.Element htmlElement = html.IFrameElement() +// ..width = '100%' +// ..height = '100%' +// ..id = 'background-html-view' +// ..src = 'https://www.youtube.com/embed/IyFZznAk69U' +// ..style.border = 'none'; + void main() { + ui_web.platformViewRegistry.registerViewFactory( + _htmlElementViewType, + (int viewId) => htmlElement, + ); + runApp(const MyApp()); } @@ -80,13 +114,13 @@ class _MyHomePageState extends State { child: Stack( alignment: Alignment.center, children: [ - NativeWidget( + HtmlElement( key: const ValueKey('background-widget'), onClick: () { - _clickedOn('native-element'); + _clickedOn('html-element'); }, ), - Column( + Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ ElevatedButton( @@ -163,3 +197,23 @@ class _MyHomePageState extends State { ); } } + +/// Initialize the videoPlayer, then render the corresponding view... +class HtmlElement extends StatelessWidget { + /// Constructor + const HtmlElement({super.key, required this.onClick}); + + /// A function to run when the element is clicked + final VoidCallback onClick; + + @override + Widget build(BuildContext context) { + htmlElement.onClick.listen((_) { + onClick(); + }); + + return const HtmlElementView( + viewType: _htmlElementViewType, + ); + } +} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/lib/native_widget.dart b/packages/pointer_interceptor/pointer_interceptor/example/lib/native_widget.dart deleted file mode 100644 index 37dc7b2a349a..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/lib/native_widget.dart +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -export 'platforms/native_widget_ios.dart' - if (dart.library.html) 'platforms/native_widget_web.dart'; diff --git a/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_ios.dart b/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_ios.dart deleted file mode 100644 index 1ce481d4544e..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_ios.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -/// A widget representing an underlying platform view. -class NativeWidget extends StatelessWidget { - /// Constructor - const NativeWidget({super.key, required this.onClick}); - - /// Placeholder param to allow web example to work - - /// onClick functionality for iOS is in the PlatformView - final VoidCallback onClick; - - @override - Widget build(BuildContext context) { - const String viewType = 'dummy_platform_view'; - final Map creationParams = {}; - - return UiKitView( - viewType: viewType, - layoutDirection: TextDirection.ltr, - creationParams: creationParams, - creationParamsCodec: const StandardMessageCodec(), - ); - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_web.dart b/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_web.dart deleted file mode 100644 index 5b9458796c5e..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor/example/lib/platforms/native_widget_web.dart +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'dart:html' as html; -import 'dart:ui_web' as ui_web; - -import 'package:flutter/material.dart'; - -/// The html.Element that will be rendered underneath the flutter UI. -html.Element htmlElement = html.DivElement() - ..style.width = '100%' - ..style.height = '100%' - ..style.backgroundColor = '#fabada' - ..style.cursor = 'auto' - ..id = 'background-html-view'; - -// See other examples commented out below... - -// html.Element htmlElement = html.VideoElement() -// ..style.width = '100%' -// ..style.height = '100%' -// ..style.cursor = 'auto' -// ..style.backgroundColor = 'black' -// ..id = 'background-html-view' -// ..src = 'https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4' -// ..poster = 'https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217' -// ..controls = true; - -// html.Element htmlElement = html.IFrameElement() -// ..width = '100%' -// ..height = '100%' -// ..id = 'background-html-view' -// ..src = 'https://www.youtube.com/embed/IyFZznAk69U' -// ..style.border = 'none'; - -const String _htmlElementViewType = '_htmlElementViewType'; - -/// A widget representing an underlying html view -class NativeWidget extends StatelessWidget { - /// Constructor - const NativeWidget({super.key, required this.onClick}); - - /// A function to run when the element is clicked - final VoidCallback onClick; - - @override - Widget build(BuildContext context) { - htmlElement.onClick.listen((_) { - onClick(); - }); - - ui_web.platformViewRegistry.registerViewFactory( - _htmlElementViewType, - (int viewId) => htmlElement, - ); - - return const HtmlElementView( - viewType: _htmlElementViewType, - ); - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart b/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart index ba15650c46ed..4ca1499d3bdb 100644 --- a/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart +++ b/packages/pointer_interceptor/pointer_interceptor/lib/pointer_interceptor.dart @@ -4,5 +4,4 @@ library pointer_interceptor; -export 'package:pointer_interceptor/src/pointer_interceptor.dart'; -export 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; +export 'src/mobile.dart' if (dart.library.html) 'src/web.dart'; diff --git a/packages/pointer_interceptor/pointer_interceptor/lib/src/pointer_interceptor.dart b/packages/pointer_interceptor/pointer_interceptor/lib/src/mobile.dart similarity index 74% rename from packages/pointer_interceptor/pointer_interceptor/lib/src/pointer_interceptor.dart rename to packages/pointer_interceptor/pointer_interceptor/lib/src/mobile.dart index c561e1403b9b..8d645ffbcfe3 100644 --- a/packages/pointer_interceptor/pointer_interceptor/lib/src/pointer_interceptor.dart +++ b/packages/pointer_interceptor/pointer_interceptor/lib/src/mobile.dart @@ -3,9 +3,8 @@ // found in the LICENSE file. import 'package:flutter/widgets.dart'; -import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; -/// A [Widget] that prevents clicks from being swallowed by PlatformViews. +/// A [Widget] that prevents clicks from being swallowed by [HtmlElementView]s. class PointerInterceptor extends StatelessWidget { /// Create a `PointerInterceptor` wrapping a `child`. // ignore: prefer_const_constructors_in_immutables @@ -30,10 +29,6 @@ class PointerInterceptor extends StatelessWidget { @override Widget build(BuildContext context) { - if (!intercepting) { - return child; - } - return PointerInterceptorPlatform.instance - .buildWidget(child: child, debug: debug, key: key); + return child; } } diff --git a/packages/pointer_interceptor/pointer_interceptor_web/lib/pointer_interceptor_web.dart b/packages/pointer_interceptor/pointer_interceptor/lib/src/web.dart similarity index 68% rename from packages/pointer_interceptor/pointer_interceptor_web/lib/pointer_interceptor_web.dart rename to packages/pointer_interceptor/pointer_interceptor/lib/src/web.dart index 33c705fc3f30..e0dbcf904ff5 100644 --- a/packages/pointer_interceptor/pointer_interceptor_web/lib/pointer_interceptor_web.dart +++ b/packages/pointer_interceptor/pointer_interceptor/lib/src/web.dart @@ -7,9 +7,6 @@ import 'dart:html' as html; import 'dart:ui_web' as ui_web; import 'package:flutter/widgets.dart'; -import 'package:flutter_web_plugins/flutter_web_plugins.dart'; - -import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; const String _viewType = '__webPointerInterceptorViewType__'; const String _debug = 'debug__'; @@ -36,14 +33,35 @@ void _registerFactory({bool debug = false}) { /// The web implementation of the `PointerInterceptor` widget. /// /// A `Widget` that prevents clicks from being swallowed by [HtmlElementView]s. -class PointerInterceptorWeb extends PointerInterceptorPlatform { - static bool _registered = false; - - /// Register the plugin - static void registerWith(Registrar? registrar) { - PointerInterceptorPlatform.instance = PointerInterceptorWeb(); +class PointerInterceptor extends StatelessWidget { + /// Creates a PointerInterceptor for the web. + PointerInterceptor({ + required this.child, + this.intercepting = true, + this.debug = false, + super.key, + }) { + if (!_registered) { + _register(); + } } + /// The `Widget` that is being wrapped by this `PointerInterceptor`. + final Widget child; + + /// Whether or not this `PointerInterceptor` should intercept pointer events. + final bool intercepting; + + /// When true, the widget renders with a semi-transparent red background, for debug purposes. + /// + /// This is useful when rendering this as a "layout" widget, like the root child + /// of a [Drawer]. + final bool debug; + + // Keeps track if this widget has already registered its view factories or not. + static bool _registered = false; + + // Registers the view factories for the interceptor widgets. static void _register() { assert(!_registered); @@ -54,20 +72,12 @@ class PointerInterceptorWeb extends PointerInterceptorPlatform { } @override - Widget buildWidget({ - required Widget child, - bool debug = false, - bool intercepting = true, - Key? key, - }) { - final String viewType = _getViewType(debug: debug); - - if (!_registered) { - _register(); - } + Widget build(BuildContext context) { if (!intercepting) { return child; } + + final String viewType = _getViewType(debug: debug); return Stack( alignment: Alignment.center, children: [ diff --git a/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml index 4915a62e6f8f..63bfccb53922 100644 --- a/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml +++ b/packages/pointer_interceptor/pointer_interceptor/pubspec.yaml @@ -2,29 +2,15 @@ name: pointer_interceptor description: A widget to prevent clicks from being swallowed by underlying HtmlElementViews on the web. repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pointer_interceptor%22 -version: 0.10.0 +version: 0.9.3+7 environment: sdk: ">=3.1.0 <4.0.0" flutter: ">=3.13.0" -flutter: - plugin: - implements: pointer_interceptor_platform_interface - platforms: - web: - default_package: pointer_interceptor_web - ios: - default_package: pointer_interceptor_ios - dependencies: flutter: sdk: flutter - flutter_web_plugins: - sdk: flutter - pointer_interceptor_ios: ^0.10.0 - pointer_interceptor_platform_interface: ^0.10.0 - pointer_interceptor_web: ^0.10.0 dev_dependencies: flutter_test: @@ -33,4 +19,3 @@ dev_dependencies: topics: - web - widgets - - pointer-interceptor diff --git a/packages/pointer_interceptor/pointer_interceptor/test/tests_exist_elsewhere_test.dart b/packages/pointer_interceptor/pointer_interceptor/test/tests_exist_elsewhere_test.dart index bf539cda25eb..cc32e6c72f1e 100644 --- a/packages/pointer_interceptor/pointer_interceptor/test/tests_exist_elsewhere_test.dart +++ b/packages/pointer_interceptor/pointer_interceptor/test/tests_exist_elsewhere_test.dart @@ -9,8 +9,8 @@ import 'package:flutter_test/flutter_test.dart'; void main() { test('Tell the user where to find the real tests', () { print('---'); - // TODO(louisehsu): add non web integration tests. - print('Please find platform tests in their respective packages.'); + print('This package uses integration_test for its tests.'); + print('See `example/README.md` for more info.'); print('---'); }); } diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/.gitignore b/packages/pointer_interceptor/pointer_interceptor_ios/.gitignore deleted file mode 100644 index ac5aa9893e48..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. -/pubspec.lock -**/doc/api/ -.dart_tool/ -build/ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/.metadata b/packages/pointer_interceptor/pointer_interceptor_ios/.metadata deleted file mode 100644 index 88292defa87f..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/.metadata +++ /dev/null @@ -1,30 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: "969911d1d09d6c4f145e9ce27c08093e8c285561" - channel: "main" - -project_type: plugin - -# Tracks metadata for the flutter migrate command -migration: - platforms: - - platform: root - create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 - base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 - - platform: ios - create_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 - base_revision: 969911d1d09d6c4f145e9ce27c08093e8c285561 - - # User provided section - - # List of Local paths (relative to this file) that should be - # ignored by the migrate tool. - # - # Files that are not part of the templates will be ignored by default. - unmanaged_files: - - 'lib/main.dart' - - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/AUTHORS b/packages/pointer_interceptor/pointer_interceptor_ios/AUTHORS deleted file mode 100644 index 8c0344813dc1..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Below is a list of people and organizations that have contributed -# to the Flutter project. Names should be added to the list like so: -# -# Name/Organization - -Google Inc. \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor_ios/CHANGELOG.md deleted file mode 100644 index 4033d9196e35..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/CHANGELOG.md +++ /dev/null @@ -1,4 +0,0 @@ -## 0.10.0 - -* Initial release. - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/LICENSE b/packages/pointer_interceptor/pointer_interceptor_ios/LICENSE deleted file mode 100644 index c6823b81eb84..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright 2013 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/README.md b/packages/pointer_interceptor/pointer_interceptor_ios/README.md deleted file mode 100644 index ca30d6d9defa..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# pointer\_interceptor\_ios - -The iOS implementation of [`pointer interceptor`][1]. - -## Usage - -This package is [endorsed][2], which means you can simply use `pointer_interceptor` -normally. This package will be automatically included in your app when you do, -so you do not need to add it to your `pubspec.yaml`. - -However, if you `import` this package to use any of its APIs directly, you -should add it to your `pubspec.yaml` as usual. - -[1]: https://pub.dev/packages/pointer_interceptor -[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/.gitignore b/packages/pointer_interceptor/pointer_interceptor_ios/example/.gitignore deleted file mode 100644 index 29a3a5017f04..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/.gitignore +++ /dev/null @@ -1,43 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.pub-cache/ -.pub/ -/build/ - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/README.md b/packages/pointer_interceptor/pointer_interceptor_ios/example/README.md deleted file mode 100644 index 96b8bb17dbff..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Platform Implementation Test App - -This is a test app for manual testing and automated integration testing -of this platform implementation. It is not intended to demonstrate actual use of -this package, since the intent is that plugin clients use the app-facing -package. - -Unless you are making changes to this implementation package, this example is -very unlikely to be relevant. diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/integration_test/pointer_interceptor_test.dart b/packages/pointer_interceptor/pointer_interceptor_ios/example/integration_test/pointer_interceptor_test.dart deleted file mode 100644 index be9e990b6cad..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/integration_test/pointer_interceptor_test.dart +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - // Full tests are done via XCUITest and can be found in RunnerUITests. - // This test just validates that the example builds and launches successfully. - testWidgets('launch test', (WidgetTester tester) async {}); -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/.gitignore b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/.gitignore deleted file mode 100644 index 7a7f9873ad7d..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/AppFrameworkInfo.plist b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index f219bde3ddf9..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - dev.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 11.0 - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Debug.xcconfig b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Debug.xcconfig deleted file mode 100644 index ec97fc6f3021..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Release.xcconfig b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Release.xcconfig deleted file mode 100644 index c4855bfe2000..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" -#include "Generated.xcconfig" diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Podfile b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Podfile deleted file mode 100644 index fdcc671eb341..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Podfile +++ /dev/null @@ -1,44 +0,0 @@ -# Uncomment this line to define a global platform for your project -# platform :ios, '11.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) - target 'RunnerTests' do - inherit! :search_paths - end -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - end -end diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.pbxproj b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index 26c357f3507e..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,875 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 46643191504C316CD4ABDB75 /* Pods_RunnerTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F7324BF52939888500E1D0F3 /* Pods_RunnerTests.framework */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - E168ED82D399C1A9329D0876 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F1F367B2EDD332D4B9230AF1 /* Pods_Runner.framework */; }; - F21CDFA32B056EBD0017C279 /* RunnerUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F21CDFA22B056EBD0017C279 /* RunnerUITests.swift */; }; - F21CDFAD2B0591E30017C279 /* DummyPlatformViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = F21CDFAC2B0591E30017C279 /* DummyPlatformViewFactory.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 97C146ED1CF9000F007C117D; - remoteInfo = Runner; - }; - F21CDFA62B056EBD0017C279 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 97C146ED1CF9000F007C117D; - remoteInfo = Runner; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 0572F01CACAE4D575F1A1128 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2DD5F6BD11575A75FA2A0EBC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - 331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = ""; }; - 331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - 37A897E52BBF8D001E20DCBE /* Pods-RunnerTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.debug.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.debug.xcconfig"; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 4231BCCD2D6A3407E2AA20F2 /* Pods-RunnerTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.release.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.release.xcconfig"; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - B65B5543E4E11276FC0745D9 /* Pods-RunnerTests.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RunnerTests.profile.xcconfig"; path = "Target Support Files/Pods-RunnerTests/Pods-RunnerTests.profile.xcconfig"; sourceTree = ""; }; - CDA7125E540D71A7A056DCE6 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - F1F367B2EDD332D4B9230AF1 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - F21CDF922B056DB70017C279 /* RunnerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerUITests.swift; sourceTree = ""; }; - F21CDFA02B056EBD0017C279 /* RunnerUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - F21CDFA22B056EBD0017C279 /* RunnerUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerUITests.swift; sourceTree = ""; }; - F21CDFAC2B0591E30017C279 /* DummyPlatformViewFactory.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DummyPlatformViewFactory.swift; sourceTree = ""; }; - F7324BF52939888500E1D0F3 /* Pods_RunnerTests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RunnerTests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 92C054B3F5E4DE78794EA034 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 46643191504C316CD4ABDB75 /* Pods_RunnerTests.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - E168ED82D399C1A9329D0876 /* Pods_Runner.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F21CDF9D2B056EBD0017C279 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 331C8082294A63A400263BE5 /* RunnerTests */ = { - isa = PBXGroup; - children = ( - 331C807B294A618700263BE5 /* RunnerTests.swift */, - ); - path = RunnerTests; - sourceTree = ""; - }; - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - F21CDF912B056DB70017C279 /* RunnerUITests */, - F21CDFA12B056EBD0017C279 /* RunnerUITests */, - 97C146EF1CF9000F007C117D /* Products */, - 331C8082294A63A400263BE5 /* RunnerTests */, - DBD25E199A731479B0BACE39 /* Pods */, - ACDADE5C43240D66CC8F6502 /* Frameworks */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - 331C8081294A63A400263BE5 /* RunnerTests.xctest */, - F21CDFA02B056EBD0017C279 /* RunnerUITests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - F21CDFAC2B0591E30017C279 /* DummyPlatformViewFactory.swift */, - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; - ACDADE5C43240D66CC8F6502 /* Frameworks */ = { - isa = PBXGroup; - children = ( - F1F367B2EDD332D4B9230AF1 /* Pods_Runner.framework */, - F7324BF52939888500E1D0F3 /* Pods_RunnerTests.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - DBD25E199A731479B0BACE39 /* Pods */ = { - isa = PBXGroup; - children = ( - 2DD5F6BD11575A75FA2A0EBC /* Pods-Runner.debug.xcconfig */, - CDA7125E540D71A7A056DCE6 /* Pods-Runner.release.xcconfig */, - 0572F01CACAE4D575F1A1128 /* Pods-Runner.profile.xcconfig */, - 37A897E52BBF8D001E20DCBE /* Pods-RunnerTests.debug.xcconfig */, - 4231BCCD2D6A3407E2AA20F2 /* Pods-RunnerTests.release.xcconfig */, - B65B5543E4E11276FC0745D9 /* Pods-RunnerTests.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; - F21CDF912B056DB70017C279 /* RunnerUITests */ = { - isa = PBXGroup; - children = ( - F21CDF922B056DB70017C279 /* RunnerUITests.swift */, - ); - path = RunnerUITests; - sourceTree = ""; - }; - F21CDFA12B056EBD0017C279 /* RunnerUITests */ = { - isa = PBXGroup; - children = ( - F21CDFA22B056EBD0017C279 /* RunnerUITests.swift */, - ); - path = RunnerUITests; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 331C8080294A63A400263BE5 /* RunnerTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */; - buildPhases = ( - DB9D75B7E0C58FFA3FAAD55B /* [CP] Check Pods Manifest.lock */, - 331C807D294A63A400263BE5 /* Sources */, - 331C807F294A63A400263BE5 /* Resources */, - 92C054B3F5E4DE78794EA034 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - 331C8086294A63A400263BE5 /* PBXTargetDependency */, - ); - name = RunnerTests; - productName = RunnerTests; - productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - C53E3297221374298B80F1DF /* [CP] Check Pods Manifest.lock */, - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - EBA0739E77CF3B079516C7F7 /* [CP] Embed Pods Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; - F21CDF9F2B056EBD0017C279 /* RunnerUITests */ = { - isa = PBXNativeTarget; - buildConfigurationList = F21CDFA82B056EBD0017C279 /* Build configuration list for PBXNativeTarget "RunnerUITests" */; - buildPhases = ( - F21CDF9C2B056EBD0017C279 /* Sources */, - F21CDF9D2B056EBD0017C279 /* Frameworks */, - F21CDF9E2B056EBD0017C279 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - F21CDFA72B056EBD0017C279 /* PBXTargetDependency */, - ); - name = RunnerUITests; - productName = RunnerUITests; - productReference = F21CDFA02B056EBD0017C279 /* RunnerUITests.xctest */; - productType = "com.apple.product-type.bundle.ui-testing"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 1500; - LastUpgradeCheck = 1430; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 331C8080294A63A400263BE5 = { - CreatedOnToolsVersion = 14.0; - TestTargetID = 97C146ED1CF9000F007C117D; - }; - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - F21CDF9F2B056EBD0017C279 = { - CreatedOnToolsVersion = 15.0; - TestTargetID = 97C146ED1CF9000F007C117D; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - 331C8080294A63A400263BE5 /* RunnerTests */, - F21CDF9F2B056EBD0017C279 /* RunnerUITests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 331C807F294A63A400263BE5 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F21CDF9E2B056EBD0017C279 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; - C53E3297221374298B80F1DF /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - DB9D75B7E0C58FFA3FAAD55B /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RunnerTests-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - EBA0739E77CF3B079516C7F7 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 331C807D294A63A400263BE5 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F21CDFAD2B0591E30017C279 /* DummyPlatformViewFactory.swift in Sources */, - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - F21CDF9C2B056EBD0017C279 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - F21CDFA32B056EBD0017C279 /* RunnerUITests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 331C8086294A63A400263BE5 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 97C146ED1CF9000F007C117D /* Runner */; - targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; - }; - F21CDFA72B056EBD0017C279 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 97C146ED1CF9000F007C117D /* Runner */; - targetProxy = F21CDFA62B056EBD0017C279 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = PZ83UV676J; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 331C8088294A63A400263BE5 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 37A897E52BBF8D001E20DCBE /* Pods-RunnerTests.debug.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Debug; - }; - 331C8089294A63A400263BE5 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 4231BCCD2D6A3407E2AA20F2 /* Pods-RunnerTests.release.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Release; - }; - 331C808A294A63A400263BE5 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = B65B5543E4E11276FC0745D9 /* Pods-RunnerTests.profile.xcconfig */; - buildSettings = { - BUNDLE_LOADER = "$(TEST_HOST)"; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - GENERATE_INFOPLIST_FILE = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample.RunnerTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = PZ83UV676J; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = PZ83UV676J; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = flutter.dev.pointerInterceptorIosExample; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; - F21CDFA92B056EBD0017C279 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GENERATE_INFOPLIST_FILE = YES; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TEST_TARGET_NAME = Runner; - }; - name = Debug; - }; - F21CDFAA2B056EBD0017C279 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GENERATE_INFOPLIST_FILE = YES; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TEST_TARGET_NAME = Runner; - }; - name = Release; - }; - F21CDFAB2B056EBD0017C279 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 1; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GENERATE_INFOPLIST_FILE = YES; - LOCALIZATION_PREFERS_STRING_CATALOGS = YES; - MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = dev.flutter.plugins.RunnerUITests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_EMIT_LOC_STRINGS = NO; - SWIFT_VERSION = 5.0; - TEST_TARGET_NAME = Runner; - }; - name = Profile; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 331C8088294A63A400263BE5 /* Debug */, - 331C8089294A63A400263BE5 /* Release */, - 331C808A294A63A400263BE5 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - F21CDFA82B056EBD0017C279 /* Build configuration list for PBXNativeTarget "RunnerUITests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - F21CDFA92B056EBD0017C279 /* Debug */, - F21CDFAA2B056EBD0017C279 /* Release */, - F21CDFAB2B056EBD0017C279 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a6254f..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5ea15..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 5b9439af8869..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 21a3cc14c74e..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003d68..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c5ea15..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift deleted file mode 100644 index 41be7b255972..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - - weak var registrar = self.registrar(forPlugin: "DummyPlatform"); - - let factory = DummyPlatformViewFactory(messenger: registrar!.messenger()) - self.registrar(forPlugin: "")!.register( - factory, - withId: "dummy_platform_view") - - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fab2d9d..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4725e9..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 7353c41ecf9c..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 797d452e4589..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index 6ed2d933e112..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cd7b0099ca8..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index fe730945a01f..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index 321773cd857a..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 797d452e4589..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index 502f463a9bc8..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index 0ec303439225..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index 0ec303439225..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index e9f5fea27c70..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index 84ac32ae7d98..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 8953cba09064..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index 0467bf12aa4d..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2fd467..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19eacad3b..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/LaunchScreen.storyboard b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c7c939..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/Main.storyboard b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index 6220510d3fbc..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift deleted file mode 100644 index 71b1bff63b14..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/DummyPlatformViewFactory.swift +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Flutter -import UIKit - -/** - * A simple factory that creates a dummy platform view for testing. - */ -public class DummyPlatformViewFactory: NSObject, FlutterPlatformViewFactory { - private var messenger: FlutterBinaryMessenger - - init(messenger: FlutterBinaryMessenger) { - self.messenger = messenger - super.init() - } - - public func create( - withFrame frame: CGRect, - viewIdentifier viewId: Int64, - arguments args: Any? - ) -> FlutterPlatformView { - return DummyPlatformView( - frame: frame, - viewIdentifier: viewId, - arguments: args, - binaryMessenger: messenger) - } - - public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { - return FlutterStandardMessageCodec.sharedInstance() - } -} - -/** - * A native view that will remove its tag if clicked. - */ -public class CustomView: UIView { - - override public func hitTest( - _ point: CGPoint, - with event: UIEvent? - ) -> UIView? { - viewWithTag(1)?.removeFromSuperview(); - return super.hitTest(point, with: event) - } -} - -/** - * A flutter platform view that displays a simple native view. - */ -class DummyPlatformView: NSObject, FlutterPlatformView { - private var _view: CustomView; - - init( - frame: CGRect, - viewIdentifier viewId: Int64, - arguments args: Any?, - binaryMessenger messenger: FlutterBinaryMessenger? - ) { - _view = CustomView() - super.init() - createNativeView(view: _view) - } - - func view() -> UIView { - return _view - } - - func createNativeView(view _view: CustomView){ - let nativeLabel = UILabel() - _view.isUserInteractionEnabled = true - nativeLabel.tag = 1; - nativeLabel.text = "Not Clicked" - nativeLabel.frame = CGRect(x: 0, y: 0, width: 180, height: 48.0) - _view.addSubview(nativeLabel) - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Info.plist b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Info.plist deleted file mode 100644 index f2156aa24df3..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - Pointer Interceptor Ios - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - pointer_interceptor_ios_example - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Runner-Bridging-Header.h b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index eb7e8ba8052f..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "GeneratedPluginRegistrant.h" diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerTests/RunnerTests.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerTests/RunnerTests.swift deleted file mode 100644 index b7859fc98cf0..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerTests/RunnerTests.swift +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import Flutter -import UIKit -import XCTest - -@testable import pointer_interceptor_ios - -class RunnerTests: XCTestCase { - func testNonDebugMode() { - let view = PointerInterceptorView( - frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: false) - - let debugView = view.view() - XCTAssertTrue(debugView.backgroundColor == UIColor.clear) - } - - func testDebugMode() { - let view = PointerInterceptorView( - frame: CGRect(x: 0, y: 0, width: 180, height: 48.0), debug: true) - - let debugView = view.view() - XCTAssertTrue(debugView.backgroundColor == UIColor(red: 1, green: 0, blue: 0, alpha: 0.5)) - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerUITests/RunnerUITests.swift b/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerUITests/RunnerUITests.swift deleted file mode 100644 index 8b797dd2627a..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/ios/RunnerUITests/RunnerUITests.swift +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import XCTest - -final class RunnerUITests: XCTestCase { - - override func setUp() { - continueAfterFailure = false - } - - func testPointerInterceptorBlocksGesturesFromFlutter() { - let app = XCUIApplication() - app.launch() - - let fabInitial = app.buttons["Initial"] - if !(fabInitial.waitForExistence(timeout: 30)) { - print(app.debugDescription) - XCTFail("Could not find Flutter button to click on") - return - } - - fabInitial.tap() - - let fabAfter = app.buttons["Tapped"] - if !(fabAfter.waitForExistence(timeout: 30)) { - print(app.debugDescription) - XCTFail("Flutter button did not change on tap") - return - } - - let exp = expectation(description: "Check platform view not clicked after 3 seconds") - let result = XCTWaiter.wait(for: [exp], timeout: 3.0) - if result == XCTWaiter.Result.timedOut { - let dummyButton = app.staticTexts["Not Clicked"] - if !(dummyButton.waitForExistence(timeout: 30)) { - print(app.debugDescription) - XCTFail("Pointer interceptor did not block gesture from hitting platform view") - return - } - } - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/lib/main.dart b/packages/pointer_interceptor/pointer_interceptor_ios/example/lib/main.dart deleted file mode 100644 index e55563bde6b3..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/lib/main.dart +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; - -void main() { - runApp(const MaterialApp(home: PointerInterceptorIOSExample())); -} - -class _DummyPlatformView extends StatelessWidget { - const _DummyPlatformView(); - - @override - Widget build(BuildContext context) { - const String viewType = 'dummy_platform_view'; - final Map creationParams = {}; - - return UiKitView( - viewType: viewType, - layoutDirection: TextDirection.ltr, - creationParams: creationParams, - creationParamsCodec: const StandardMessageCodec(), - ); - } -} - -/// Example flutter app with a button overlaying the native view. -class PointerInterceptorIOSExample extends StatefulWidget { - /// Constructor - const PointerInterceptorIOSExample({super.key}); - - @override - State createState() { - return _PointerInterceptorIOSExampleState(); - } -} - -class _PointerInterceptorIOSExampleState - extends State { - bool _buttonTapped = false; - - @override - Widget build(BuildContext context) { - return Scaffold( - body: Center( - child: Stack( - alignment: AlignmentDirectional.center, - children: [ - const _DummyPlatformView(), - PointerInterceptorPlatform.instance.buildWidget( - child: TextButton( - style: TextButton.styleFrom(foregroundColor: Colors.red), - child: _buttonTapped - ? const Text('Tapped') - : const Text('Initial'), - onPressed: () { - setState(() { - _buttonTapped = !_buttonTapped; - }); - })), - ], - ), - )); - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_ios/example/pubspec.yaml deleted file mode 100644 index b97c8fe10bfc..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/pubspec.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: pointer_interceptor_ios_example -description: "Demonstrates how to use the pointer_interceptor_ios plugin." -publish_to: 'none' - -environment: - sdk: '>=3.1.0 <4.0.0' - flutter: '>=3.13.0' - -dependencies: - cupertino_icons: ^1.0.2 - flutter: - sdk: flutter - pointer_interceptor_ios: - path: ../../pointer_interceptor_ios - pointer_interceptor_platform_interface: ^0.10.0 - -dev_dependencies: - flutter_test: - sdk: flutter - integration_test: - sdk: flutter - -flutter: - uses-material-design: true - diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/example/test_driver/integration_test.dart b/packages/pointer_interceptor/pointer_interceptor_ios/example/test_driver/integration_test.dart deleted file mode 100644 index f26b6a310cfe..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/example/test_driver/integration_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:integration_test/integration_test_driver.dart'; - -Future main() async => integrationDriver(); diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/.gitignore b/packages/pointer_interceptor/pointer_interceptor_ios/ios/.gitignore deleted file mode 100644 index 0c885071e36b..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/ios/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -.idea/ -.vagrant/ -.sconsign.dblite -.svn/ - -.DS_Store -*.swp -profile - -DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - -.generated/ - -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - -!default.pbxuser -!default.mode1v3 -!default.mode2v3 -!default.perspectivev3 - -xcuserdata - -*.moved-aside - -*.pyc -*sync/ -Icon? -.tags* - -/Flutter/Generated.xcconfig -/Flutter/ephemeral/ -/Flutter/flutter_export_environment.sh \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Assets/.gitkeep b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Assets/.gitkeep deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorFactory.swift b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorFactory.swift deleted file mode 100644 index 809b3deae847..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorFactory.swift +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -import Flutter - -class PointerInterceptorFactory: NSObject, FlutterPlatformViewFactory { - func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) - -> FlutterPlatformView - { - let debug = (args as? [String: Any])?["debug"] as? Bool ?? false - return PointerInterceptorView(frame: frame, debug: debug) - } - - public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { - return FlutterStandardMessageCodec.sharedInstance() - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorIosPlugin.swift b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorIosPlugin.swift deleted file mode 100644 index 81b803c409e7..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorIosPlugin.swift +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -import Flutter -import UIKit - -public class PointerInterceptorIosPlugin: NSObject, FlutterPlugin { - public static func register(with registrar: FlutterPluginRegistrar) { - registrar.register( - PointerInterceptorFactory(), withId: "plugins.flutter.dev/pointer_interceptor_ios") - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorView.swift b/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorView.swift deleted file mode 100644 index bacb6c797cf8..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/ios/Classes/PointerInterceptorView.swift +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -import Flutter -import UIKit - -public class PointerInterceptorView: NSObject, FlutterPlatformView { - - let interceptorView: UIView - - init(frame: CGRect, debug: Bool) { - interceptorView = UIView(frame: frame) - interceptorView.backgroundColor = - debug ? UIColor(red: 1, green: 0, blue: 0, alpha: 0.5) : UIColor.clear - } - - public func view() -> UIView { - return interceptorView - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/ios/pointer_interceptor_ios.podspec b/packages/pointer_interceptor/pointer_interceptor_ios/ios/pointer_interceptor_ios.podspec deleted file mode 100644 index 301ed379505f..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/ios/pointer_interceptor_ios.podspec +++ /dev/null @@ -1,26 +0,0 @@ -# -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. -# Run `pod lib lint pointer_interceptor_ios.podspec` to validate before publishing. -# -Pod::Spec.new do |s| - s.name = 'pointer_interceptor_ios' - s.version = '0.0.1' - s.summary = 'Implementation of pointer_interceptor for iOS.' - s.description = <<-DESC -This Flutter plugin provides means to prevent gestures from being swallowed by PlatformView on iOS. - DESC - s.homepage = 'https://github.com/flutter/packages' - s.license = { :type => 'BSD', :file => '../LICENSE' } - s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } - s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_ios' } - s.source_files = 'Classes/**/*' - s.dependency 'Flutter' - s.platform = :ios, '11.0' - # Flutter.framework does not contain a i386 slice. - s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } - s.swift_version = '5.0' - s.xcconfig = { - 'LIBRARY_SEARCH_PATHS' => '$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)/ $(SDKROOT)/usr/lib/swift', - 'LD_RUNPATH_SEARCH_PATHS' => '/usr/lib/swift', - } -end diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/lib/pointer_interceptor_ios.dart b/packages/pointer_interceptor/pointer_interceptor_ios/lib/pointer_interceptor_ios.dart deleted file mode 100644 index f92e8faaec0e..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/lib/pointer_interceptor_ios.dart +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/services.dart'; -import 'package:flutter/widgets.dart'; -import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; - -/// The iOS implementation of the [PointerInterceptorPlatform]. -class PointerInterceptorIOS extends PointerInterceptorPlatform { - /// Register plugin as iOS version. - static void registerWith() { - PointerInterceptorPlatform.instance = PointerInterceptorIOS(); - } - - @override - Widget buildWidget({required Widget child, bool debug = false, Key? key}) { - return Stack(alignment: Alignment.center, children: [ - Positioned.fill( - child: UiKitView( - viewType: 'plugins.flutter.dev/pointer_interceptor_ios', - creationParams: { - 'debug': debug, - }, - creationParamsCodec: const StandardMessageCodec(), - )), - child - ]); - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_ios/pubspec.yaml deleted file mode 100644 index ccd165417e10..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/pubspec.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: pointer_interceptor_ios -description: iOS implementation of the pointer_interceptor plugin. -repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_ios -issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apointer_interceptor -version: 0.10.0 - -environment: - sdk: '>=3.1.0 <4.0.0' - flutter: '>=3.13.0' - -flutter: - plugin: - implements: pointer_interceptor - platforms: - ios: - pluginClass: PointerInterceptorIosPlugin - dartPluginClass: PointerInterceptorIOS - -dependencies: - flutter: - sdk: flutter - plugin_platform_interface: ^2.1.6 - pointer_interceptor_platform_interface: ^0.10.0 - -dev_dependencies: - flutter_test: - sdk: flutter - -topics: - - pointer-interceptor - - ios \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_ios/test/pointer_interceptor_ios_test.dart b/packages/pointer_interceptor/pointer_interceptor_ios/test/pointer_interceptor_ios_test.dart deleted file mode 100644 index 35671246ea5b..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_ios/test/pointer_interceptor_ios_test.dart +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:pointer_interceptor_ios/pointer_interceptor_ios.dart'; - -class TestApp extends StatefulWidget { - const TestApp({super.key}); - - @override - State createState() { - return TestAppState(); - } -} - -class TestAppState extends State { - String _buttonText = 'Test Button'; - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - body: const Text('Body'), - floatingActionButton: FloatingActionButton( - onPressed: () {}, - child: PointerInterceptorIOS().buildWidget( - child: TextButton( - onPressed: () => setState(() { - _buttonText = 'Clicked'; - }), - child: Text(_buttonText), - ))), - )); - } -} - -void main() { - testWidgets( - 'Button remains clickable and is added to ' - 'hierarchy after being wrapped in pointer interceptor', - (WidgetTester tester) async { - await tester.pumpWidget(const TestApp()); - await tester.tap(find.text('Test Button')); - await tester.pump(); - expect(find.text('Clicked'), findsOneWidget); - }); -} diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/AUTHORS b/packages/pointer_interceptor/pointer_interceptor_platform_interface/AUTHORS deleted file mode 100644 index e8063a8cd6e5..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Below is a list of people and organizations that have contributed -# to the project. Names should be added to the list like so: -# -# Name/Organization - -Google Inc. diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor_platform_interface/CHANGELOG.md deleted file mode 100644 index f4c3d3e1bc4e..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/CHANGELOG.md +++ /dev/null @@ -1,3 +0,0 @@ -## 0.10.0 - -* Initial release from migration to federated architecture. diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/LICENSE b/packages/pointer_interceptor/pointer_interceptor_platform_interface/LICENSE deleted file mode 100644 index c6823b81eb84..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright 2013 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/README.md b/packages/pointer_interceptor/pointer_interceptor_platform_interface/README.md deleted file mode 100644 index a2030bfb6321..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# pointer_interceptor_platform_interface - -A common platform interface for the [`pointer_interceptor`][1] plugin. - -This interface allows platform-specific implementations of the `pointer_interceptor` -plugin, as well as the plugin itself, to ensure they are supporting the -same interface. - -# Usage - -To implement a new platform-specific implementation of `pointer_interceptor`, extend -[`PointerInterceptorPlatform`][2] with an implementation that performs the -platform-specific behavior, and when you register your plugin, set the default -`PointerInterceptorPlatform` by calling -`PointerInterceptorPlatform.instance = MyPointerInterceptorPlatform()`. - -# Note on breaking changes - -Strongly prefer non-breaking changes (such as adding a method to the interface) -over breaking changes for this package. - -See https://flutter.dev/go/platform-interface-breaking-changes for a discussion -on why a less-clean interface is preferable to a breaking change. - -[1]: https://pub.dev/packages/pointer_interceptor -[2]: lib/src/pointer_interceptor_platform.dart \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/pointer_interceptor_platform_interface.dart b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/pointer_interceptor_platform_interface.dart deleted file mode 100644 index 284f6225ea9d..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/pointer_interceptor_platform_interface.dart +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -export 'src/pointer_interceptor_platform.dart'; diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/default_pointer_interceptor.dart b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/default_pointer_interceptor.dart deleted file mode 100644 index e3a591120d5e..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/default_pointer_interceptor.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/widgets.dart'; - -import 'pointer_interceptor_platform.dart'; - -/// A default no-op implementation of [PointerInterceptorPlatform]. -class DefaultPointerInterceptor extends PointerInterceptorPlatform { - @override - Widget buildWidget({ - required Widget child, - bool debug = false, - Key? key, - }) { - return child; - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/pointer_interceptor_platform.dart b/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/pointer_interceptor_platform.dart deleted file mode 100644 index 59b558a7b1f3..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/lib/src/pointer_interceptor_platform.dart +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/widgets.dart'; -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -import 'default_pointer_interceptor.dart'; - -/// Platform-specific implementations should set this with their own -/// platform-specific class that extends [PointerInterceptorPlatform] when -/// they register themselves. -abstract class PointerInterceptorPlatform extends PlatformInterface { - /// Constructs a PointerInterceptorPlatform. - PointerInterceptorPlatform() : super(token: _token); - - static final Object _token = Object(); - - static PointerInterceptorPlatform _instance = DefaultPointerInterceptor(); - - static set instance(PointerInterceptorPlatform? instance) { - if (instance == null) { - throw AssertionError( - 'Platform interfaces can only be set to a non-null instance'); - } - - PlatformInterface.verify(instance, _token); - _instance = instance; - } - - /// The default instance of [PointerInterceptorPlatform] to use. - /// - /// Defaults to [DefaultPointerInterceptor], which does not do anything - static PointerInterceptorPlatform get instance => _instance; - - /// Platform-specific implementations should override this function their own - /// implementation of a pointer interceptor widget. - Widget buildWidget({ - required Widget child, - bool debug = false, - Key? key, - }) { - throw UnimplementedError('buildWidget() has not been implemented.'); - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_platform_interface/pubspec.yaml deleted file mode 100644 index e7bb8738c407..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/pubspec.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: pointer_interceptor_platform_interface -description: "A common platform interface for the pointer_interceptor plugin." -repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_platform_interface -issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pointer_interceptor%22 - -version: 0.10.0 - -environment: - sdk: '>=3.1.0 <4.0.0' - flutter: '>=3.13.0' - -dependencies: - flutter: - sdk: flutter - plugin_platform_interface: ^2.1.0 - -dev_dependencies: - flutter_test: - sdk: flutter - -topics: - - widgets - - platform-views - - pointer-interceptor diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/test/default_pointer_interceptor_test.dart b/packages/pointer_interceptor/pointer_interceptor_platform_interface/test/default_pointer_interceptor_test.dart deleted file mode 100644 index 1489cd90dc1b..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/test/default_pointer_interceptor_test.dart +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/cupertino.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - test('Default implementation of PointerInterceptor does not do anything', () { - final PointerInterceptorPlatform defaultPointerInterceptor = - PointerInterceptorPlatform.instance; - - final Container testChild = Container(); - expect(defaultPointerInterceptor.buildWidget(child: testChild), testChild); - }); -} diff --git a/packages/pointer_interceptor/pointer_interceptor_platform_interface/test/pointer_interceptor_platform_test.dart b/packages/pointer_interceptor/pointer_interceptor_platform_interface/test/pointer_interceptor_platform_test.dart deleted file mode 100644 index bf3291deea49..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_platform_interface/test/pointer_interceptor_platform_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/cupertino.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - test( - 'Default implementation of PointerInterceptorPlatform should throw unimplemented error', - () { - final PointerInterceptorPlatform unimplementedPointerInterceptorPlatform = - UnimplementedPointerInterceptorPlatform(); - - final Container testChild = Container(); - expect( - () => unimplementedPointerInterceptorPlatform.buildWidget( - child: testChild), - throwsUnimplementedError); - }); -} - -class UnimplementedPointerInterceptorPlatform - extends PointerInterceptorPlatform {} diff --git a/packages/pointer_interceptor/pointer_interceptor_web/AUTHORS b/packages/pointer_interceptor/pointer_interceptor_web/AUTHORS deleted file mode 100644 index 8c0344813dc1..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/AUTHORS +++ /dev/null @@ -1,6 +0,0 @@ -# Below is a list of people and organizations that have contributed -# to the Flutter project. Names should be added to the list like so: -# -# Name/Organization - -Google Inc. \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md b/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md deleted file mode 100644 index f8b01ae32a54..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/CHANGELOG.md +++ /dev/null @@ -1,4 +0,0 @@ -## 0.10.0 - -* Moves web implementation to its own package. - diff --git a/packages/pointer_interceptor/pointer_interceptor_web/LICENSE b/packages/pointer_interceptor/pointer_interceptor_web/LICENSE deleted file mode 100644 index c6823b81eb84..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/LICENSE +++ /dev/null @@ -1,25 +0,0 @@ -Copyright 2013 The Flutter Authors. All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - * Neither the name of Google Inc. nor the names of its - contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/packages/pointer_interceptor/pointer_interceptor_web/README.md b/packages/pointer_interceptor/pointer_interceptor_web/README.md deleted file mode 100644 index 45db9bdcbc7d..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# pointer\_interceptor\_web - -The web implementation of [`pointer interceptor`][1]. - -## Usage - -This package is [endorsed][2], which means you can simply use `pointer_interceptor` -normally. This package will be automatically included in your app when you do, -so you do not need to add it to your `pubspec.yaml`. - -However, if you `import` this package to use any of its APIs directly, you -should add it to your `pubspec.yaml` as usual. - -[1]: https://pub.dev/packages/pointer_interceptor -[2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin \ No newline at end of file diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/README.md b/packages/pointer_interceptor/pointer_interceptor_web/example/README.md deleted file mode 100644 index 96b8bb17dbff..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Platform Implementation Test App - -This is a test app for manual testing and automated integration testing -of this platform implementation. It is not intended to demonstrate actual use of -this package, since the intent is that plugin clients use the app-facing -package. - -Unless you are making changes to this implementation package, this example is -very unlikely to be relevant. diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/integration_test/widget_test.dart b/packages/pointer_interceptor/pointer_interceptor_web/example/integration_test/widget_test.dart deleted file mode 100644 index 22a2528f7d15..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/integration_test/widget_test.dart +++ /dev/null @@ -1,179 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// ignore_for_file: avoid_print - -import 'dart:html' as html; - -// Imports the Flutter Driver API. -import 'package:flutter/src/widgets/framework.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; - -import 'package:pointer_interceptor_web_example/main.dart' as app; - -final Finder nonClickableButtonFinder = - find.byKey(const Key('transparent-button')); -final Finder clickableWrappedButtonFinder = - find.byKey(const Key('wrapped-transparent-button')); -final Finder clickableButtonFinder = find.byKey(const Key('clickable-button')); -final Finder backgroundFinder = - find.byKey(const ValueKey('background-widget')); - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - group('Without semantics', () { - testWidgets( - 'on wrapped elements, the browser does not hit the background-html-view', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAtCenter(clickableButtonFinder, tester); - - expect(element.id, isNot('background-html-view')); - }, semanticsEnabled: false); - - testWidgets( - 'on wrapped elements with intercepting set to false, the browser hits the background-html-view', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAtCenter(clickableWrappedButtonFinder, tester); - - expect(element.id, 'background-html-view'); - }, semanticsEnabled: false); - - testWidgets( - 'on unwrapped elements, the browser hits the background-html-view', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAtCenter(nonClickableButtonFinder, tester); - - expect(element.id, 'background-html-view'); - }, semanticsEnabled: false); - - testWidgets('on background directly', (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAt(tester.getTopLeft(backgroundFinder)); - - expect(element.id, 'background-html-view'); - }, semanticsEnabled: false); - }); - - group('With semantics', () { - testWidgets('finds semantics of wrapped widgets', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - if (!_newSemanticsAvailable()) { - print('Skipping test: Needs flutter > 2.10'); - return; - } - - final html.Element element = - _getHtmlElementAtCenter(clickableButtonFinder, tester); - - expect(element.tagName.toLowerCase(), 'flt-semantics'); - expect(element.getAttribute('aria-label'), 'Works As Expected'); - }); - - testWidgets( - 'finds semantics of wrapped widgets with intercepting set to false', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - if (!_newSemanticsAvailable()) { - print('Skipping test: Needs flutter > 2.10'); - return; - } - - final html.Element element = - _getHtmlElementAtCenter(clickableWrappedButtonFinder, tester); - - expect(element.tagName.toLowerCase(), 'flt-semantics'); - expect(element.getAttribute('aria-label'), - 'Never calls onPressed transparent'); - }); - - testWidgets('finds semantics of unwrapped elements', - (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - if (!_newSemanticsAvailable()) { - print('Skipping test: Needs flutter > 2.10'); - return; - } - - final html.Element element = - _getHtmlElementAtCenter(nonClickableButtonFinder, tester); - - expect(element.tagName.toLowerCase(), 'flt-semantics'); - expect(element.getAttribute('aria-label'), 'Never calls onPressed'); - }); - - // Notice that, when hit-testing the background platform view, instead of - // finding a semantics node, the platform view itself is found. This is - // because the platform view does not add interactive semantics nodes into - // the framework's semantics tree. Instead, its semantics is determined by - // the HTML content of the platform view itself. Flutter's semantics tree - // simply allows the hit test to land on the platform view by making itself - // hit test transparent. - testWidgets('on background directly', (WidgetTester tester) async { - app.main(); - await tester.pumpAndSettle(); - - final html.Element element = - _getHtmlElementAt(tester.getTopLeft(backgroundFinder)); - - expect(element.id, 'background-html-view'); - }); - }); -} - -// Calls [_getHtmlElementAt] passing it the center of the widget identified by -// the `finder`. -html.Element _getHtmlElementAtCenter(Finder finder, WidgetTester tester) { - final Offset point = tester.getCenter(finder); - return _getHtmlElementAt(point); -} - -// Locates the DOM element at the given `point` using `elementFromPoint`. -// -// `elementFromPoint` is an approximate proxy for a hit test, although it's -// sensitive to the presence of shadow roots and browser quirks (not all -// browsers agree on what it should return in all situations). Since this test -// runs only in Chromium, it relies on Chromium's behavior. -html.Element _getHtmlElementAt(Offset point) { - // Probe at the shadow so the browser reports semantics nodes in addition to - // platform view elements. If probed from `html.document` the browser hides - // the contents of as an implementation detail. - final html.ShadowRoot glassPaneShadow = - html.document.querySelector('flt-glass-pane')!.shadowRoot!; - return glassPaneShadow.elementFromPoint(point.dx.toInt(), point.dy.toInt())!; -} - -// TODO(dit): Remove this after flutter master (2.13) lands into stable. -// This detects that we can do new semantics assertions by looking at the 'id' -// attribute on flt-semantics elements (it is now set in 2.13 and up). -bool _newSemanticsAvailable() { - final html.ShadowRoot glassPaneShadow = - html.document.querySelector('flt-glass-pane')!.shadowRoot!; - final List elements = - glassPaneShadow.querySelectorAll('flt-semantics[id]'); - return elements.isNotEmpty; -} diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/lib/main.dart b/packages/pointer_interceptor/pointer_interceptor_web/example/lib/main.dart deleted file mode 100644 index 5a3723a011d0..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/lib/main.dart +++ /dev/null @@ -1,218 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// ignore: avoid_web_libraries_in_flutter -import 'dart:html' as html; -import 'dart:ui_web' as ui_web; - -import 'package:flutter/material.dart'; -import 'package:pointer_interceptor_platform_interface/pointer_interceptor_platform_interface.dart'; -import 'package:pointer_interceptor_web/pointer_interceptor_web.dart'; - -const String _htmlElementViewType = '_htmlElementViewType'; -const double _videoWidth = 640; -const double _videoHeight = 480; - -/// The html.Element that will be rendered underneath the flutter UI. -html.Element htmlElement = html.DivElement() - ..style.width = '100%' - ..style.height = '100%' - ..style.backgroundColor = '#fabada' - ..style.cursor = 'auto' - ..id = 'background-html-view'; - -// See other examples commented out below... - -// html.Element htmlElement = html.VideoElement() -// ..style.width = '100%' -// ..style.height = '100%' -// ..style.cursor = 'auto' -// ..style.backgroundColor = 'black' -// ..id = 'background-html-view' -// ..src = 'https://archive.org/download/BigBuckBunny_124/Content/big_buck_bunny_720p_surround.mp4' -// ..poster = 'https://peach.blender.org/wp-content/uploads/title_anouncement.jpg?x11217' -// ..controls = true; - -// html.Element htmlElement = html.IFrameElement() -// ..width = '100%' -// ..height = '100%' -// ..id = 'background-html-view' -// ..src = 'https://www.youtube.com/embed/IyFZznAk69U' -// ..style.border = 'none'; - -void main() { - ui_web.platformViewRegistry.registerViewFactory( - _htmlElementViewType, - (int viewId) => htmlElement, - ); - runApp(const MyApp()); -} - -/// Main app -class MyApp extends StatelessWidget { - /// Creates main app. - const MyApp({super.key}); - - @override - Widget build(BuildContext context) { - return const MaterialApp( - title: 'Stopping Clicks with PointerInterceptor', - home: MyHomePage(), - ); - } -} - -/// First page -class MyHomePage extends StatefulWidget { - /// Creates first page. - const MyHomePage({super.key}); - - @override - State createState() => _MyHomePageState(); -} - -class _MyHomePageState extends State { - String _lastClick = 'none'; - - void _clickedOn(String key) { - setState(() { - _lastClick = key; - }); - } - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('PointerInterceptor demo'), - actions: [ - PointerInterceptorPlatform.instance.buildWidget( - // debug: true, - child: IconButton( - icon: const Icon(Icons.add_alert), - tooltip: 'AppBar Icon', - onPressed: () { - _clickedOn('appbar-icon'); - }, - ), - ), - ], - ), - body: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'Last click on: $_lastClick', - key: const Key('last-clicked'), - ), - Container( - color: Colors.black, - width: _videoWidth, - height: _videoHeight, - child: Stack( - alignment: Alignment.center, - children: [ - HtmlElement( - key: const ValueKey('background-widget'), - onClick: () { - _clickedOn('html-element'); - }, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - ElevatedButton( - key: const Key('transparent-button'), - child: const Text('Never calls onPressed'), - onPressed: () { - _clickedOn('transparent-button'); - }, - ), - PointerInterceptorWeb().buildWidget( - intercepting: false, - child: ElevatedButton( - key: const Key('wrapped-transparent-button'), - child: - const Text('Never calls onPressed transparent'), - onPressed: () { - _clickedOn('wrapped-transparent-button'); - }, - )), - PointerInterceptorPlatform.instance.buildWidget( - child: ElevatedButton( - key: const Key('clickable-button'), - child: const Text('Works As Expected'), - onPressed: () { - _clickedOn('clickable-button'); - }, - ), - ), - ], - ), - ], - ), - ), - ], - ), - ), - floatingActionButton: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - PointerInterceptorPlatform.instance.buildWidget( - // debug: true, - child: FloatingActionButton( - child: const Icon(Icons.navigation), - onPressed: () { - _clickedOn('fab-1'); - }, - ), - ), - ], - ), - drawer: Drawer( - child: PointerInterceptorPlatform.instance.buildWidget( - // debug: true, // Enable this to "see" the interceptor covering the column. - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - ListTile( - title: const Text('Item 1'), - onTap: () { - _clickedOn('drawer-item-1'); - }, - ), - ListTile( - title: const Text('Item 2'), - onTap: () { - _clickedOn('drawer-item-2'); - }, - ), - ], - ), - ), - ), - ); - } -} - -/// Initialize the videoPlayer, then render the corresponding view... -class HtmlElement extends StatelessWidget { - /// Constructor - const HtmlElement({super.key, required this.onClick}); - - /// A function to run when the element is clicked - final VoidCallback onClick; - - @override - Widget build(BuildContext context) { - htmlElement.onClick.listen((_) { - onClick(); - }); - - return const HtmlElementView( - viewType: _htmlElementViewType, - ); - } -} diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml deleted file mode 100644 index e3f7b95066e7..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/pubspec.yaml +++ /dev/null @@ -1,25 +0,0 @@ -name: pointer_interceptor_web_example -description: "Demonstrates how to use the pointer_interceptor_web plugin." -publish_to: 'none' - -environment: - sdk: ">=3.1.0 <4.0.0" - flutter: ">=3.13.0" - -dependencies: - cupertino_icons: ^1.0.2 - flutter: - sdk: flutter - pointer_interceptor_platform_interface: ^0.10.0 - pointer_interceptor_web: - path: ../../pointer_interceptor_web - -dev_dependencies: - flutter_test: - sdk: flutter - integration_test: - sdk: flutter - -flutter: - uses-material-design: true - diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/test_driver/integration_test.dart b/packages/pointer_interceptor/pointer_interceptor_web/example/test_driver/integration_test.dart deleted file mode 100644 index f26b6a310cfe..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/test_driver/integration_test.dart +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:integration_test/integration_test_driver.dart'; - -Future main() async => integrationDriver(); diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/favicon.png b/packages/pointer_interceptor/pointer_interceptor_web/example/web/favicon.png deleted file mode 100644 index 8aaa46ac1ae2..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_web/example/web/favicon.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-192.png b/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-192.png deleted file mode 100644 index b749bfef0747..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-192.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-512.png b/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48dff11..000000000000 Binary files a/packages/pointer_interceptor/pointer_interceptor_web/example/web/icons/Icon-512.png and /dev/null differ diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/index.html b/packages/pointer_interceptor/pointer_interceptor_web/example/web/index.html deleted file mode 100644 index a53f5677b573..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/web/index.html +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - example - - - - - - - - diff --git a/packages/pointer_interceptor/pointer_interceptor_web/example/web/manifest.json b/packages/pointer_interceptor/pointer_interceptor_web/example/web/manifest.json deleted file mode 100644 index 8c012917dab7..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/example/web/manifest.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "example", - "short_name": "example", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - } - ] -} diff --git a/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml b/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml deleted file mode 100644 index cebf7f9daabd..000000000000 --- a/packages/pointer_interceptor/pointer_interceptor_web/pubspec.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: pointer_interceptor_web -description: Web implementation of the pointer_interceptor plugin. -repository: https://github.com/flutter/packages/tree/main/packages/pointer_interceptor/pointer_interceptor_web -issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apointer_interceptor -version: 0.10.0 - -environment: - sdk: '>=3.1.0 <4.0.0' - flutter: '>=3.13.0' - -flutter: - plugin: - implements: pointer_interceptor - platforms: - web: - pluginClass: PointerInterceptorWeb - fileName: pointer_interceptor_web.dart - -dependencies: - flutter: - sdk: flutter - flutter_web_plugins: - sdk: flutter - plugin_platform_interface: ^2.1.6 - pointer_interceptor_platform_interface: ^0.10.0 - -dev_dependencies: - flutter_test: - sdk: flutter - -topics: - - pointer-interceptor - - web \ No newline at end of file diff --git a/packages/quick_actions/quick_actions/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/quick_actions/quick_actions/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/quick_actions/quick_actions/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/quick_actions/quick_actions/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/quick_actions/quick_actions/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/quick_actions/quick_actions/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/quick_actions/quick_actions/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/quick_actions/quick_actions/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/quick_actions/quick_actions/pubspec.yaml b/packages/quick_actions/quick_actions/pubspec.yaml index 96a6f61e2479..46aba43d376d 100644 --- a/packages/quick_actions/quick_actions/pubspec.yaml +++ b/packages/quick_actions/quick_actions/pubspec.yaml @@ -29,7 +29,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 plugin_platform_interface: ^2.0.0 topics: diff --git a/packages/quick_actions/quick_actions_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/quick_actions/quick_actions_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/quick_actions/quick_actions_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/quick_actions/quick_actions_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/quick_actions/quick_actions_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/quick_actions/quick_actions_android/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..ceccc3a85403 100644 --- a/packages/quick_actions/quick_actions_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/quick_actions/quick_actions_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml b/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml index cd45e46a7daf..b17c5a0008bc 100644 --- a/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml +++ b/packages/quick_actions/quick_actions_platform_interface/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - quick-actions diff --git a/packages/rfw/CHANGELOG.md b/packages/rfw/CHANGELOG.md index 986072d8433e..871821f4a3b0 100644 --- a/packages/rfw/CHANGELOG.md +++ b/packages/rfw/CHANGELOG.md @@ -1,7 +1,6 @@ ## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Fixes lint warnings. ## 1.0.15 diff --git a/packages/rfw/example/hello/android/gradle/wrapper/gradle-wrapper.properties b/packages/rfw/example/hello/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/rfw/example/hello/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/rfw/example/hello/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/rfw/example/local/android/gradle/wrapper/gradle-wrapper.properties b/packages/rfw/example/local/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/rfw/example/local/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/rfw/example/local/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/rfw/example/remote/android/gradle/wrapper/gradle-wrapper.properties b/packages/rfw/example/remote/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/rfw/example/remote/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/rfw/example/remote/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/rfw/lib/src/flutter/argument_decoders.dart b/packages/rfw/lib/src/flutter/argument_decoders.dart index 41db3bf95b96..2b627c35be4e 100644 --- a/packages/rfw/lib/src/flutter/argument_decoders.dart +++ b/packages/rfw/lib/src/flutter/argument_decoders.dart @@ -9,7 +9,6 @@ // This file is hand-formatted. import 'dart:math' as math show pi; -// ignore: unnecessary_import, see https://github.com/flutter/flutter/pull/138881 import 'dart:ui' show FontFeature; // TODO(ianh): https://github.com/flutter/flutter/issues/87235 import 'package:flutter/material.dart'; diff --git a/packages/rfw/lib/src/flutter/core_widgets.dart b/packages/rfw/lib/src/flutter/core_widgets.dart index 04f3acab01a7..ac2790ceb42f 100644 --- a/packages/rfw/lib/src/flutter/core_widgets.dart +++ b/packages/rfw/lib/src/flutter/core_widgets.dart @@ -8,7 +8,6 @@ // This file is hand-formatted. -// ignore: unnecessary_import, see https://github.com/flutter/flutter/pull/138881 import 'dart:ui' show FontFeature; import 'package:flutter/gestures.dart' show DragStartBehavior; diff --git a/packages/shared_preferences/shared_preferences/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/shared_preferences/shared_preferences/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/shared_preferences/shared_preferences/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/shared_preferences/shared_preferences/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/shared_preferences/shared_preferences_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/shared_preferences/shared_preferences_android/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/shared_preferences/shared_preferences_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/shared_preferences/shared_preferences_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/two_dimensional_scrollables/CHANGELOG.md b/packages/two_dimensional_scrollables/CHANGELOG.md index a47fd6b40c76..b61ddbd53a56 100644 --- a/packages/two_dimensional_scrollables/CHANGELOG.md +++ b/packages/two_dimensional_scrollables/CHANGELOG.md @@ -1,6 +1,5 @@ -## 0.0.5 +## NEXT -* Exposes addAutomaticKeepAlives in TableCellBuilderDelegate and TableCellListDelegate * Fixes bug where having one reversed axis caused incorrect painting of a pinned row. * Adds support for BorderRadius in TableSpanDecorations. diff --git a/packages/two_dimensional_scrollables/dart_test.yaml b/packages/two_dimensional_scrollables/dart_test.yaml new file mode 100644 index 000000000000..5ea7fe8ae51c --- /dev/null +++ b/packages/two_dimensional_scrollables/dart_test.yaml @@ -0,0 +1,3 @@ +# TODO(Piinks): Web cannot support temp golden files, re-enable once mock_canvas +# makes it to stable. See +test_on: vm diff --git a/packages/two_dimensional_scrollables/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/two_dimensional_scrollables/example/android/gradle/wrapper/gradle-wrapper.properties index e1ca574ef017..3c472b99c6f3 100644 --- a/packages/two_dimensional_scrollables/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/two_dimensional_scrollables/example/android/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip diff --git a/packages/two_dimensional_scrollables/example/pubspec.yaml b/packages/two_dimensional_scrollables/example/pubspec.yaml index 675a9c3991f1..a36e620a5562 100644 --- a/packages/two_dimensional_scrollables/example/pubspec.yaml +++ b/packages/two_dimensional_scrollables/example/pubspec.yaml @@ -6,8 +6,8 @@ publish_to: 'none' version: 1.0.0+1 environment: - sdk: '>=3.2.0 <4.0.0' - flutter: ">=3.16.0" + sdk: '>=3.1.0 <4.0.0' + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/two_dimensional_scrollables/lib/src/table_view/table_delegate.dart b/packages/two_dimensional_scrollables/lib/src/table_view/table_delegate.dart index 275bfb5bae48..86accc4f999b 100644 --- a/packages/two_dimensional_scrollables/lib/src/table_view/table_delegate.dart +++ b/packages/two_dimensional_scrollables/lib/src/table_view/table_delegate.dart @@ -125,7 +125,6 @@ class TableCellBuilderDelegate extends TwoDimensionalChildBuilderDelegate int pinnedColumnCount = 0, int pinnedRowCount = 0, super.addRepaintBoundaries, - super.addAutomaticKeepAlives, required TableViewCellBuilder cellBuilder, required TableSpanBuilder columnBuilder, required TableSpanBuilder rowBuilder, @@ -150,6 +149,8 @@ class TableCellBuilderDelegate extends TwoDimensionalChildBuilderDelegate int get columnCount => maxXIndex! + 1; set columnCount(int value) { assert(pinnedColumnCount <= value); + // TODO(Piinks): remove once this assertion is added in the super class + assert(value >= -1); maxXIndex = value - 1; } @@ -178,6 +179,8 @@ class TableCellBuilderDelegate extends TwoDimensionalChildBuilderDelegate int get rowCount => maxYIndex! + 1; set rowCount(int value) { assert(pinnedRowCount <= value); + // TODO(Piinks): remove once this assertion is added in the super class + assert(value >= -1); maxYIndex = value - 1; } @@ -216,7 +219,6 @@ class TableCellListDelegate extends TwoDimensionalChildListDelegate int pinnedColumnCount = 0, int pinnedRowCount = 0, super.addRepaintBoundaries, - super.addAutomaticKeepAlives, required List> cells, required TableSpanBuilder columnBuilder, required TableSpanBuilder rowBuilder, diff --git a/packages/two_dimensional_scrollables/pubspec.yaml b/packages/two_dimensional_scrollables/pubspec.yaml index 34fecd511114..9a392a8bf4b2 100644 --- a/packages/two_dimensional_scrollables/pubspec.yaml +++ b/packages/two_dimensional_scrollables/pubspec.yaml @@ -1,12 +1,12 @@ name: two_dimensional_scrollables description: Widgets that scroll using the two dimensional scrolling foundation. -version: 0.0.5 +version: 0.0.4 repository: https://github.com/flutter/packages/tree/main/packages/two_dimensional_scrollables issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+two_dimensional_scrollables%22+ environment: - sdk: '>=3.2.0 <4.0.0' - flutter: ">=3.16.0" + sdk: '>=3.1.0 <4.0.0' + flutter: ">=3.13.0" dependencies: flutter: diff --git a/packages/two_dimensional_scrollables/test/table_view/goldens/reversed.pinned.painting.png b/packages/two_dimensional_scrollables/test/table_view/goldens/reversed.pinned.painting.png new file mode 100644 index 000000000000..f3355f07dfe1 Binary files /dev/null and b/packages/two_dimensional_scrollables/test/table_view/goldens/reversed.pinned.painting.png differ diff --git a/packages/two_dimensional_scrollables/test/table_view/goldens/single-reversed.pinned.painting.png b/packages/two_dimensional_scrollables/test/table_view/goldens/single-reversed.pinned.painting.png new file mode 100644 index 000000000000..a89a27353c14 Binary files /dev/null and b/packages/two_dimensional_scrollables/test/table_view/goldens/single-reversed.pinned.painting.png differ diff --git a/packages/two_dimensional_scrollables/test/table_view/goldens/tableSpanDecoration.defaultMainAxis.png b/packages/two_dimensional_scrollables/test/table_view/goldens/tableSpanDecoration.defaultMainAxis.png new file mode 100644 index 000000000000..47c77cd4b132 Binary files /dev/null and b/packages/two_dimensional_scrollables/test/table_view/goldens/tableSpanDecoration.defaultMainAxis.png differ diff --git a/packages/two_dimensional_scrollables/test/table_view/goldens/tableSpanDecoration.horizontalMainAxis.png b/packages/two_dimensional_scrollables/test/table_view/goldens/tableSpanDecoration.horizontalMainAxis.png new file mode 100644 index 000000000000..6a04b91e480a Binary files /dev/null and b/packages/two_dimensional_scrollables/test/table_view/goldens/tableSpanDecoration.horizontalMainAxis.png differ diff --git a/packages/two_dimensional_scrollables/test/table_view/table_delegate_test.dart b/packages/two_dimensional_scrollables/test/table_view/table_delegate_test.dart index 5d919222f75d..98e88fcfd55e 100644 --- a/packages/two_dimensional_scrollables/test/table_view/table_delegate_test.dart +++ b/packages/two_dimensional_scrollables/test/table_view/table_delegate_test.dart @@ -11,18 +11,6 @@ const Widget cell = SizedBox.shrink(); void main() { group('TableCellBuilderDelegate', () { - test('exposes addAutomaticKeepAlives from super class', () { - final TableCellBuilderDelegate delegate = TableCellBuilderDelegate( - cellBuilder: (_, __) => cell, - columnBuilder: (_) => span, - rowBuilder: (_) => span, - columnCount: 5, - rowCount: 6, - addAutomaticKeepAlives: false, - ); - expect(delegate.addAutomaticKeepAlives, isFalse); - }); - test('asserts valid counts for rows and columns', () { TableCellBuilderDelegate? delegate; expect( @@ -217,16 +205,6 @@ void main() { }); group('TableCellListDelegate', () { - test('exposes addAutomaticKeepAlives from super class', () { - final TableCellListDelegate delegate = TableCellListDelegate( - cells: >[[]], - columnBuilder: (_) => span, - rowBuilder: (_) => span, - addAutomaticKeepAlives: false, - ); - expect(delegate.addAutomaticKeepAlives, isFalse); - }); - test('asserts valid counts for rows and columns', () { TableCellListDelegate? delegate; expect( diff --git a/packages/two_dimensional_scrollables/test/table_view/table_test.dart b/packages/two_dimensional_scrollables/test/table_view/table_test.dart index 670caf00b620..d910b772bce7 100644 --- a/packages/two_dimensional_scrollables/test/table_view/table_test.dart +++ b/packages/two_dimensional_scrollables/test/table_view/table_test.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:io' show Platform; + import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -38,6 +40,14 @@ TableSpan getMouseTrackingSpan( ); } +final bool masterChannel = !Platform.environment.containsKey('CHANNEL') || + Platform.environment['CHANNEL'] == 'master'; + +// TODO(Piinks): Remove once painting can be validated by mock_canvas in +// flutter_test, and re-enable web tests in https://github.com/flutter/flutter/issues/132782 +// Regenerate goldens on a Mac computer by running `flutter test --update-goldens` +final bool runGoldens = Platform.isMacOS && masterChannel; + void main() { group('TableView.builder', () { test('creates correct delegate', () { @@ -1243,6 +1253,11 @@ void main() { testWidgets('paints decorations in correct order', (WidgetTester tester) async { + // TODO(Piinks): Rewrite this to remove golden files from this repo when + // mock_canvas is public - https://github.com/flutter/flutter/pull/131631 + // * foreground, background, and precedence per mainAxis + // * Break out a separate test for padding and radius decorations to + // validate paint rect calls TableView tableView = TableView.builder( rowCount: 2, columnCount: 2, @@ -1289,123 +1304,17 @@ void main() { height: 200, width: 200, color: Colors.grey.withOpacity(0.5), + child: const Center(child: FlutterLogo()), ); }, ); await tester.pumpWidget(MaterialApp(home: tableView)); await tester.pumpAndSettle(); - expect( - find.byType(TableViewport), - paints - // background row - ..rrect( - rrect: RRect.fromRectAndRadius( - const Rect.fromLTRB(0.0, 210.0, 410.0, 410.0), - const Radius.circular(30.0), - ), - color: const Color(0xff2196f3), - ) - // background column - ..rrect( - rrect: RRect.fromRectAndRadius( - const Rect.fromLTRB(0.0, 0.0, 210.0, 410.0), - const Radius.circular(30.0), - ), - color: const Color(0xfff44336), - ) - // child at 0,0 - ..rect( - rect: const Rect.fromLTRB(0.0, 0.0, 200.0, 200.0), - color: const Color(0x809e9e9e), - ) - // child at 0,1 - ..rect( - rect: const Rect.fromLTRB(0.0, 210.0, 200.0, 410.0), - color: const Color(0x809e9e9e), - ) - // child at 1,0 - ..rect( - rect: const Rect.fromLTRB(210.0, 0.0, 410.0, 200.0), - color: const Color(0x809e9e9e), - ) - // child at 1,1 - ..rect( - rect: const Rect.fromLTRB(210.0, 210.0, 410.0, 410.0), - color: const Color(0x809e9e9e), - ) - // foreground row border (1) - ..drrect( - outer: RRect.fromRectAndRadius( - const Rect.fromLTRB(0.0, 0.0, 410.0, 200.0), - const Radius.circular(30.0), - ), - inner: RRect.fromLTRBAndCorners( - 0.0, - 3.0, - 410.0, - 200.0, - topLeft: const Radius.elliptical(30.0, 27.0), - topRight: const Radius.elliptical(30.0, 27.0), - bottomRight: const Radius.circular(30.0), - bottomLeft: const Radius.circular(30.0), - ), - color: const Color(0xff4caf50), - ) - // foreground row border (2) - ..drrect( - outer: RRect.fromRectAndRadius( - const Rect.fromLTRB(0.0, 200.0, 410.0, 410.0), - const Radius.circular(30.0), - ), - inner: RRect.fromLTRBAndCorners( - 0.0, - 203.0, - 410.0, - 410.0, - topLeft: const Radius.elliptical(30.0, 27.0), - topRight: const Radius.elliptical(30.0, 27.0), - bottomRight: const Radius.circular(30.0), - bottomLeft: const Radius.circular(30.0), - ), - color: const Color(0xff4caf50), - ) - // foreground column border (1) - ..drrect( - outer: RRect.fromRectAndRadius( - const Rect.fromLTRB(0.0, 0.0, 200.0, 410.0), - const Radius.circular(10.0), - ), - inner: RRect.fromLTRBAndCorners( - 0.0, - 0.0, - 197.0, - 410.0, - topLeft: const Radius.circular(10.0), - topRight: const Radius.elliptical(7.0, 10.0), - bottomRight: const Radius.elliptical(7.0, 10.0), - bottomLeft: const Radius.circular(10.0), - ), - color: const Color(0xffff9800), - ) - // foreground column border (2) - ..drrect( - outer: RRect.fromRectAndRadius( - const Rect.fromLTRB(210.0, 0.0, 410.0, 410.0), - const Radius.circular(10.0), - ), - inner: RRect.fromLTRBAndCorners( - 210.0, - 0.0, - 407.0, - 410.0, - topLeft: const Radius.circular(10.0), - topRight: const Radius.elliptical(7.0, 10.0), - bottomRight: const Radius.elliptical(7.0, 10.0), - bottomLeft: const Radius.circular(10.0), - ), - color: const Color(0xffff9800), - ), + await expectLater( + find.byType(TableView), + matchesGoldenFile('goldens/tableSpanDecoration.defaultMainAxis.png'), + skip: !runGoldens, ); // Switch main axis @@ -1442,90 +1351,27 @@ void main() { ), ), cellBuilder: (_, TableVicinity vicinity) { - return Container( - height: 200, - width: 200, - color: Colors.grey.withOpacity(0.5), + return const SizedBox.square( + dimension: 200, + child: Center(child: FlutterLogo()), ); }, ); await tester.pumpWidget(MaterialApp(home: tableView)); await tester.pumpAndSettle(); - expect( - find.byType(TableViewport), - paints - // background column goes first this time - ..rect( - rect: const Rect.fromLTRB(0.0, 0.0, 200.0, 400.0), - color: const Color(0xfff44336), - ) - // background row - ..rect( - rect: const Rect.fromLTRB(0.0, 200.0, 400.0, 400.0), - color: const Color(0xff2196f3), - ) - // child at 0,0 - ..rect( - rect: const Rect.fromLTRB(0.0, 0.0, 200.0, 200.0), - color: const Color(0x809e9e9e), - ) - // child at 1,0 - ..rect( - rect: const Rect.fromLTRB(0.0, 200.0, 200.0, 400.0), - color: const Color(0x809e9e9e), - ) - // child at 0,1 - ..rect( - rect: const Rect.fromLTRB(200.0, 0.0, 400.0, 200.0), - color: const Color(0x809e9e9e), - ) - // child at 1,1 - ..rect( - rect: const Rect.fromLTRB(200.0, 200.0, 400.0, 400.0), - color: const Color(0x809e9e9e), - ) - // foreground column border (1) - ..path( - includes: [ - const Offset(200.0, 0.0), - const Offset(200.0, 200.0), - const Offset(200.0, 400.0), - ], - color: const Color(0xffff9800), - ) - // foreground column border (2) - ..path( - includes: [ - const Offset(400.0, 0.0), - const Offset(400.0, 200.0), - const Offset(400.0, 400.0), - ], - color: const Color(0xffff9800), - ) - // foreground row border - ..path( - includes: [ - Offset.zero, - const Offset(200.0, 0.0), - const Offset(400.0, 0.0), - ], - color: const Color(0xff4caf50), - ) - // foreground row border(2) - ..path( - includes: [ - const Offset(0.0, 200.0), - const Offset(200.0, 200.0), - const Offset(400.0, 200.0), - ], - color: const Color(0xff4caf50), - ), + await expectLater( + find.byType(TableView), + matchesGoldenFile('goldens/tableSpanDecoration.horizontalMainAxis.png'), + skip: !runGoldens, ); }); - testWidgets('child paint rects are correct when reversed and pinned', + testWidgets('paint rects are correct when reversed and pinned', (WidgetTester tester) async { + // TODO(Piinks): Rewrite this to remove golden files from this repo when + // mock_canvas is public - https://github.com/flutter/flutter/pull/131631 + // * foreground, background, and precedence per mainAxis // Both reversed - Regression test for https://github.com/flutter/flutter/issues/135386 TableView tableView = TableView.builder( verticalDetails: const ScrollableDetails.vertical(reverse: true), @@ -1534,43 +1380,48 @@ void main() { pinnedRowCount: 1, columnCount: 2, pinnedColumnCount: 1, - columnBuilder: (int index) => const TableSpan( - extent: FixedTableSpanExtent(200.0), + columnBuilder: (int index) => TableSpan( + extent: const FixedTableSpanExtent(200.0), + foregroundDecoration: const TableSpanDecoration( + border: TableSpanBorder( + trailing: BorderSide( + color: Colors.orange, + width: 3, + ), + ), + ), + backgroundDecoration: TableSpanDecoration( + color: index.isEven ? Colors.red : null, + ), ), - rowBuilder: (int index) => const TableSpan( - extent: FixedTableSpanExtent(200.0), + rowBuilder: (int index) => TableSpan( + extent: const FixedTableSpanExtent(200.0), + foregroundDecoration: const TableSpanDecoration( + border: TableSpanBorder( + leading: BorderSide( + color: Colors.green, + width: 3, + ), + ), + ), + backgroundDecoration: TableSpanDecoration( + color: index.isOdd ? Colors.blue : null, + ), ), cellBuilder: (_, TableVicinity vicinity) { - return Container( - height: 200, - width: 200, - color: Colors.grey.withOpacity(0.5), + return const SizedBox.square( + dimension: 200, + child: Center(child: FlutterLogo()), ); }, ); await tester.pumpWidget(MaterialApp(home: tableView)); await tester.pumpAndSettle(); - // All children are painted in the right place - expect( - find.byType(TableViewport), - paints - ..rect( - rect: const Rect.fromLTRB(400.0, 200.0, 600.0, 400.0), - color: const Color(0x809e9e9e), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, 200.0, 800.0, 400.0), - color: const Color(0x809e9e9e), - ) - ..rect( - rect: const Rect.fromLTRB(400.0, 400.0, 600.0, 600.0), - color: const Color(0x809e9e9e), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, 400.0, 800.0, 600.0), - color: const Color(0x809e9e9e), - ), + await expectLater( + find.byType(TableView), + matchesGoldenFile('goldens/reversed.pinned.painting.png'), + skip: !runGoldens, ); // Only one axis reversed - Regression test for https://github.com/flutter/flutter/issues/136897 @@ -1580,42 +1431,48 @@ void main() { pinnedRowCount: 1, columnCount: 2, pinnedColumnCount: 1, - columnBuilder: (int index) => const TableSpan( - extent: FixedTableSpanExtent(200.0), + columnBuilder: (int index) => TableSpan( + extent: const FixedTableSpanExtent(200.0), + foregroundDecoration: const TableSpanDecoration( + border: TableSpanBorder( + trailing: BorderSide( + color: Colors.orange, + width: 3, + ), + ), + ), + backgroundDecoration: TableSpanDecoration( + color: index.isEven ? Colors.red : null, + ), ), - rowBuilder: (int index) => const TableSpan( - extent: FixedTableSpanExtent(200.0), + rowBuilder: (int index) => TableSpan( + extent: const FixedTableSpanExtent(200.0), + foregroundDecoration: const TableSpanDecoration( + border: TableSpanBorder( + leading: BorderSide( + color: Colors.green, + width: 3, + ), + ), + ), + backgroundDecoration: TableSpanDecoration( + color: index.isOdd ? Colors.blue : null, + ), ), cellBuilder: (_, TableVicinity vicinity) { - return Container( - height: 200, - width: 200, - color: Colors.grey.withOpacity(0.5), + return const SizedBox.square( + dimension: 200, + child: Center(child: FlutterLogo()), ); }, ); await tester.pumpWidget(MaterialApp(home: tableView)); await tester.pumpAndSettle(); - expect( - find.byType(TableViewport), - paints - ..rect( - rect: const Rect.fromLTRB(400.0, 200.0, 600.0, 400.0), - color: const Color(0x809e9e9e), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, 200.0, 800.0, 400.0), - color: const Color(0x809e9e9e), - ) - ..rect( - rect: const Rect.fromLTRB(400.0, 0.0, 600.0, 200.0), - color: const Color(0x809e9e9e), - ) - ..rect( - rect: const Rect.fromLTRB(600.0, 0.0, 800.0, 200.0), - color: const Color(0x809e9e9e), - ), + await expectLater( + find.byType(TableView), + matchesGoldenFile('goldens/single-reversed.pinned.painting.png'), + skip: !runGoldens, ); }); diff --git a/packages/url_launcher/url_launcher/CHANGELOG.md b/packages/url_launcher/url_launcher/CHANGELOG.md index c1523e11d150..db1516640df6 100644 --- a/packages/url_launcher/url_launcher/CHANGELOG.md +++ b/packages/url_launcher/url_launcher/CHANGELOG.md @@ -1,8 +1,3 @@ -## 6.2.2 - -* Adds a link about web limitations to the `url_launcher_web` package in the - `url_launcher` `README.md` and `launchUrl` method. - ## 6.2.1 * Fixes incorrect types in `supportsLaunchMode` and diff --git a/packages/url_launcher/url_launcher/README.md b/packages/url_launcher/url_launcher/README.md index 642346f97010..bb69a52fb91f 100644 --- a/packages/url_launcher/url_launcher/README.md +++ b/packages/url_launcher/url_launcher/README.md @@ -98,13 +98,6 @@ See [the Android documentation](https://developer.android.com/training/package-visibility/use-cases) for examples of other queries. -### Web - -Some web browsers may have limitations (e.g. a launch must be triggered by a -user action). Check -[package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) -for more web-specific information. - ## Supported URL schemes The provided URL is passed directly to the host platform for handling. The diff --git a/packages/url_launcher/url_launcher/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/url_launcher/url_launcher/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/url_launcher/url_launcher/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/url_launcher/url_launcher/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/url_launcher/url_launcher/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/url_launcher/url_launcher/example/android/gradle/wrapper/gradle-wrapper.properties index 067458b986d5..e85f978c7b55 100644 --- a/packages/url_launcher/url_launcher/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/url_launcher/url_launcher/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/url_launcher/url_launcher/example/pubspec.yaml b/packages/url_launcher/url_launcher/example/pubspec.yaml index 8951d07fc48a..18cc9c450443 100644 --- a/packages/url_launcher/url_launcher/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher/example/pubspec.yaml @@ -24,7 +24,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 plugin_platform_interface: ^2.0.0 flutter: diff --git a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart index d91558a673a8..23ea836b7406 100644 --- a/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart +++ b/packages/url_launcher/url_launcher/lib/src/url_launcher_uri.dart @@ -29,11 +29,6 @@ import 'type_conversion.dart'; /// - "_self" opens the new URL in the current tab. /// Default behaviour when unset is to open the url in a new tab. /// -/// Web browsers prevent launching URLs in a new tab/window, unless -/// triggered by a user action (e.g. a button click). See -/// [package:url_launcher_web](https://pub.dev/packages/url_launcher_web#limitations-on-the-web-platform) -/// for more details. -/// /// Returns true if the URL was launched successful, otherwise either returns /// false or throws a [PlatformException] depending on the failure. Future launchUrl( diff --git a/packages/url_launcher/url_launcher/pubspec.yaml b/packages/url_launcher/url_launcher/pubspec.yaml index 3a5c71ea9a30..5947671ffea7 100644 --- a/packages/url_launcher/url_launcher/pubspec.yaml +++ b/packages/url_launcher/url_launcher/pubspec.yaml @@ -3,7 +3,7 @@ description: Flutter plugin for launching a URL. Supports web, phone, SMS, and email schemes. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 6.2.2 +version: 6.2.1 environment: sdk: ">=3.1.0 <4.0.0" @@ -41,7 +41,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 plugin_platform_interface: ^2.0.0 test: ^1.16.3 diff --git a/packages/url_launcher/url_launcher_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/url_launcher/url_launcher_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/url_launcher/url_launcher_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/url_launcher/url_launcher_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/url_launcher/url_launcher_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/url_launcher/url_launcher_android/example/android/gradle/wrapper/gradle-wrapper.properties index 067458b986d5..e85f978c7b55 100644 --- a/packages/url_launcher/url_launcher_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/url_launcher/url_launcher_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/url_launcher/url_launcher_android/example/pubspec.yaml b/packages/url_launcher/url_launcher_android/example/pubspec.yaml index 0587fd6d95ca..58893cd95405 100644 --- a/packages/url_launcher/url_launcher_android/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/example/pubspec.yaml @@ -23,7 +23,7 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 plugin_platform_interface: ^2.0.0 flutter: diff --git a/packages/url_launcher/url_launcher_android/pubspec.yaml b/packages/url_launcher/url_launcher_android/pubspec.yaml index 6a51e813d751..d21428906d63 100644 --- a/packages/url_launcher/url_launcher_android/pubspec.yaml +++ b/packages/url_launcher/url_launcher_android/pubspec.yaml @@ -24,7 +24,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^10.0.0 plugin_platform_interface: ^2.0.0 test: ^1.16.3 diff --git a/packages/url_launcher/url_launcher_ios/pubspec.yaml b/packages/url_launcher/url_launcher_ios/pubspec.yaml index 677221f47aef..5629f1f37c0a 100644 --- a/packages/url_launcher/url_launcher_ios/pubspec.yaml +++ b/packages/url_launcher/url_launcher_ios/pubspec.yaml @@ -25,7 +25,7 @@ dev_dependencies: build_runner: ^2.3.3 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.2 pigeon: ^11.0.1 plugin_platform_interface: ^2.0.0 test: ^1.16.3 diff --git a/packages/url_launcher/url_launcher_ios/test/url_launcher_ios_test.mocks.dart b/packages/url_launcher/url_launcher_ios/test/url_launcher_ios_test.mocks.dart index 973d50574aab..e9eccab16213 100644 --- a/packages/url_launcher/url_launcher_ios/test/url_launcher_ios_test.mocks.dart +++ b/packages/url_launcher/url_launcher_ios/test/url_launcher_ios_test.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.2 from annotations // in url_launcher_ios/test/url_launcher_ios_test.dart. // Do not manually edit this file. @@ -12,8 +12,6 @@ import 'package:url_launcher_ios/src/messages.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/url_launcher/url_launcher_linux/CHANGELOG.md b/packages/url_launcher/url_launcher_linux/CHANGELOG.md index 54b486e4dc66..ff9548532f92 100644 --- a/packages/url_launcher/url_launcher_linux/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_linux/CHANGELOG.md @@ -1,7 +1,5 @@ -## 3.1.1 +## NEXT -* Implements `launchUrl`. -* Simplifies method channel interface by removing unused elements. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 3.1.0 diff --git a/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart b/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart index ed425a0357ae..286ac923ce9b 100644 --- a/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart +++ b/packages/url_launcher/url_launcher_linux/lib/url_launcher_linux.dart @@ -22,8 +22,11 @@ class UrlLauncherLinux extends UrlLauncherPlatform { final LinkDelegate? linkDelegate = null; @override - Future canLaunch(String url) async { - return (await _channel.invokeMethod('canLaunch', url)) ?? false; + Future canLaunch(String url) { + return _channel.invokeMethod( + 'canLaunch', + {'url': url}, + ).then((bool? value) => value ?? false); } @override @@ -37,14 +40,16 @@ class UrlLauncherLinux extends UrlLauncherPlatform { required Map headers, String? webOnlyWindowName, }) { - // None of the options are supported, so they don't need to be converted to - // LaunchOptions. - return launchUrl(url, const LaunchOptions()); - } - - @override - Future launchUrl(String url, LaunchOptions options) async { - return (await _channel.invokeMethod('launch', url)) ?? false; + return _channel.invokeMethod( + 'launch', + { + 'url': url, + 'enableJavaScript': enableJavaScript, + 'enableDomStorage': enableDomStorage, + 'universalLinksOnly': universalLinksOnly, + 'headers': headers, + }, + ).then((bool? value) => value ?? false); } @override diff --git a/packages/url_launcher/url_launcher_linux/linux/test/url_launcher_linux_test.cc b/packages/url_launcher/url_launcher_linux/linux/test/url_launcher_linux_test.cc index 7d48008a6eb3..2aa37aabb0b1 100644 --- a/packages/url_launcher/url_launcher_linux/linux/test/url_launcher_linux_test.cc +++ b/packages/url_launcher/url_launcher_linux/linux/test/url_launcher_linux_test.cc @@ -15,7 +15,9 @@ namespace url_launcher_plugin { namespace test { TEST(UrlLauncherPlugin, CanLaunchSuccess) { - g_autoptr(FlValue) args = fl_value_new_string("https://flutter.dev"); + g_autoptr(FlValue) args = fl_value_new_map(); + fl_value_set_string_take(args, "url", + fl_value_new_string("https://flutter.dev")); g_autoptr(FlMethodResponse) response = can_launch(nullptr, args); ASSERT_NE(response, nullptr); ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response)); @@ -26,7 +28,8 @@ TEST(UrlLauncherPlugin, CanLaunchSuccess) { } TEST(UrlLauncherPlugin, CanLaunchFailureUnhandled) { - g_autoptr(FlValue) args = fl_value_new_string("madeup:scheme"); + g_autoptr(FlValue) args = fl_value_new_map(); + fl_value_set_string_take(args, "url", fl_value_new_string("madeup:scheme")); g_autoptr(FlMethodResponse) response = can_launch(nullptr, args); ASSERT_NE(response, nullptr); ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response)); @@ -37,7 +40,8 @@ TEST(UrlLauncherPlugin, CanLaunchFailureUnhandled) { } TEST(UrlLauncherPlugin, CanLaunchFileSuccess) { - g_autoptr(FlValue) args = fl_value_new_string("file:///"); + g_autoptr(FlValue) args = fl_value_new_map(); + fl_value_set_string_take(args, "url", fl_value_new_string("file:///")); g_autoptr(FlMethodResponse) response = can_launch(nullptr, args); ASSERT_NE(response, nullptr); ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response)); @@ -48,8 +52,9 @@ TEST(UrlLauncherPlugin, CanLaunchFileSuccess) { } TEST(UrlLauncherPlugin, CanLaunchFailureInvalidFileExtension) { - g_autoptr(FlValue) args = - fl_value_new_string("file:///madeup.madeupextension"); + g_autoptr(FlValue) args = fl_value_new_map(); + fl_value_set_string_take( + args, "url", fl_value_new_string("file:///madeup.madeupextension")); g_autoptr(FlMethodResponse) response = can_launch(nullptr, args); ASSERT_NE(response, nullptr); ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response)); @@ -62,7 +67,8 @@ TEST(UrlLauncherPlugin, CanLaunchFailureInvalidFileExtension) { // For consistency with the established mobile implementations, // an invalid URL should return false, not an error. TEST(UrlLauncherPlugin, CanLaunchFailureInvalidUrl) { - g_autoptr(FlValue) args = fl_value_new_string(""); + g_autoptr(FlValue) args = fl_value_new_map(); + fl_value_set_string_take(args, "url", fl_value_new_string("")); g_autoptr(FlMethodResponse) response = can_launch(nullptr, args); ASSERT_NE(response, nullptr); ASSERT_TRUE(FL_IS_METHOD_SUCCESS_RESPONSE(response)); diff --git a/packages/url_launcher/url_launcher_linux/linux/url_launcher_plugin.cc b/packages/url_launcher/url_launcher_linux/linux/url_launcher_plugin.cc index b12b394516ed..b0c7fece0e7c 100644 --- a/packages/url_launcher/url_launcher_linux/linux/url_launcher_plugin.cc +++ b/packages/url_launcher/url_launcher_linux/linux/url_launcher_plugin.cc @@ -13,9 +13,11 @@ // See url_launcher_channel.dart for documentation. const char kChannelName[] = "plugins.flutter.io/url_launcher_linux"; +const char kBadArgumentsError[] = "Bad Arguments"; const char kLaunchError[] = "Launch Error"; const char kCanLaunchMethod[] = "canLaunch"; const char kLaunchMethod[] = "launch"; +const char kUrlKey[] = "url"; struct _FlUrlLauncherPlugin { GObject parent_instance; @@ -28,6 +30,21 @@ struct _FlUrlLauncherPlugin { G_DEFINE_TYPE(FlUrlLauncherPlugin, fl_url_launcher_plugin, g_object_get_type()) +// Gets the URL from the arguments or generates an error. +static gchar* get_url(FlValue* args, GError** error) { + if (fl_value_get_type(args) != FL_VALUE_TYPE_MAP) { + g_set_error(error, 0, 0, "Argument map missing or malformed"); + return nullptr; + } + FlValue* url_value = fl_value_lookup_string(args, kUrlKey); + if (url_value == nullptr) { + g_set_error(error, 0, 0, "Missing URL"); + return nullptr; + } + + return g_strdup(fl_value_get_string(url_value)); +} + // Checks if URI has launchable file resource. static gboolean can_launch_uri_with_file_resource(FlUrlLauncherPlugin* self, const gchar* url) { @@ -40,7 +57,12 @@ static gboolean can_launch_uri_with_file_resource(FlUrlLauncherPlugin* self, // Called to check if a URL can be launched. FlMethodResponse* can_launch(FlUrlLauncherPlugin* self, FlValue* args) { - const gchar* url = fl_value_get_string(args); + g_autoptr(GError) error = nullptr; + g_autofree gchar* url = get_url(args, &error); + if (url == nullptr) { + return FL_METHOD_RESPONSE(fl_method_error_response_new( + kBadArgumentsError, error->message, nullptr)); + } gboolean is_launchable = FALSE; g_autofree gchar* scheme = g_uri_parse_scheme(url); @@ -60,10 +82,14 @@ FlMethodResponse* can_launch(FlUrlLauncherPlugin* self, FlValue* args) { // Called when a URL should launch. static FlMethodResponse* launch(FlUrlLauncherPlugin* self, FlValue* args) { - const gchar* url = fl_value_get_string(args); + g_autoptr(GError) error = nullptr; + g_autofree gchar* url = get_url(args, &error); + if (url == nullptr) { + return FL_METHOD_RESPONSE(fl_method_error_response_new( + kBadArgumentsError, error->message, nullptr)); + } FlView* view = fl_plugin_registrar_get_view(self->registrar); - g_autoptr(GError) error = nullptr; gboolean launched; if (view != nullptr) { GtkWindow* window = GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(view))); diff --git a/packages/url_launcher/url_launcher_linux/pubspec.yaml b/packages/url_launcher/url_launcher_linux/pubspec.yaml index 46642f23b0fe..274d09642fed 100644 --- a/packages/url_launcher/url_launcher_linux/pubspec.yaml +++ b/packages/url_launcher/url_launcher_linux/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_linux description: Linux implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_linux issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 3.1.1 +version: 3.1.0 environment: sdk: ">=3.0.0 <4.0.0" diff --git a/packages/url_launcher/url_launcher_linux/test/url_launcher_linux_test.dart b/packages/url_launcher/url_launcher_linux/test/url_launcher_linux_test.dart index 9f4f36249b97..c7e6c8e328c6 100644 --- a/packages/url_launcher/url_launcher_linux/test/url_launcher_linux_test.dart +++ b/packages/url_launcher/url_launcher_linux/test/url_launcher_linux_test.dart @@ -38,7 +38,11 @@ void main() { await launcher.canLaunch('http://example.com/'); expect( log, - [isMethodCall('canLaunch', arguments: 'http://example.com/')], + [ + isMethodCall('canLaunch', arguments: { + 'url': 'http://example.com/', + }) + ], ); }); @@ -62,7 +66,65 @@ void main() { ); expect( log, - [isMethodCall('launch', arguments: 'http://example.com/')], + [ + isMethodCall('launch', arguments: { + 'url': 'http://example.com/', + 'enableJavaScript': false, + 'enableDomStorage': false, + 'universalLinksOnly': false, + 'headers': {}, + }) + ], + ); + }); + + test('launch with headers', () async { + final UrlLauncherLinux launcher = UrlLauncherLinux(); + await launcher.launch( + 'http://example.com/', + useSafariVC: true, + useWebView: false, + enableJavaScript: false, + enableDomStorage: false, + universalLinksOnly: false, + headers: const {'key': 'value'}, + ); + expect( + log, + [ + isMethodCall('launch', arguments: { + 'url': 'http://example.com/', + 'enableJavaScript': false, + 'enableDomStorage': false, + 'universalLinksOnly': false, + 'headers': {'key': 'value'}, + }) + ], + ); + }); + + test('launch universal links only', () async { + final UrlLauncherLinux launcher = UrlLauncherLinux(); + await launcher.launch( + 'http://example.com/', + useSafariVC: false, + useWebView: false, + enableJavaScript: false, + enableDomStorage: false, + universalLinksOnly: true, + headers: const {}, + ); + expect( + log, + [ + isMethodCall('launch', arguments: { + 'url': 'http://example.com/', + 'enableJavaScript': false, + 'enableDomStorage': false, + 'universalLinksOnly': true, + 'headers': {}, + }) + ], ); }); @@ -81,25 +143,6 @@ void main() { expect(launched, false); }); - group('launchUrl', () { - test('passes URL', () async { - final UrlLauncherLinux launcher = UrlLauncherLinux(); - await launcher.launchUrl('http://example.com/', const LaunchOptions()); - expect( - log, - [isMethodCall('launch', arguments: 'http://example.com/')], - ); - }); - - test('returns false if platform returns null', () async { - final UrlLauncherLinux launcher = UrlLauncherLinux(); - final bool launched = await launcher.launchUrl( - 'http://example.com/', const LaunchOptions()); - - expect(launched, false); - }); - }); - group('supportsMode', () { test('returns true for platformDefault', () async { final UrlLauncherLinux launcher = UrlLauncherLinux(); diff --git a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml index c90efd867e8d..5d11d9884df7 100644 --- a/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml +++ b/packages/url_launcher/url_launcher_platform_interface/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - links diff --git a/packages/url_launcher/url_launcher_web/CHANGELOG.md b/packages/url_launcher/url_launcher_web/CHANGELOG.md index ed6042312a10..76979c9c4c61 100644 --- a/packages/url_launcher/url_launcher_web/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_web/CHANGELOG.md @@ -1,13 +1,3 @@ -## 2.2.2 - -* Adds documentation that a launch in a new window/tab needs to be triggered by - a user action. - -## 2.2.1 - -* Supports Flutter Web + Wasm -* Updates minimum supported SDK version to Flutter 3.16.0/Dart 3.2.0. - ## 2.2.0 * Implements `supportsMode` and `supportsCloseForMode`. diff --git a/packages/url_launcher/url_launcher_web/README.md b/packages/url_launcher/url_launcher_web/README.md index f186d7a49bb8..bcea84855915 100644 --- a/packages/url_launcher/url_launcher_web/README.md +++ b/packages/url_launcher/url_launcher_web/README.md @@ -13,21 +13,3 @@ should add it to your `pubspec.yaml` as usual. [1]: https://pub.dev/packages/url_launcher [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin - -## Limitations on the Web platform - -### A launch needs to be triggered by a user action - -Web browsers prevent launching URLs in a new tab/window, unless triggered by a -user action (e.g. a button click). - -Even if a user triggers a launch through a button click, if there is a delay due -to awaiting a Future before the launch, the browser may still block it. This is -because the browser might perceive the launch as not being a direct result of -user interaction, particularly if the Future takes too long to complete. - -In such cases, you can use the `webOnlyWindowName` parameter, setting it to -`_self`, to open the URL within the current tab. Another approach is to ensure -that the `uri` is synchronously ready. - -Read more: MDN > [Transient activation](https://developer.mozilla.org/en-US/docs/Glossary/Transient_activation). \ No newline at end of file diff --git a/packages/url_launcher/url_launcher_web/example/build.yaml b/packages/url_launcher/url_launcher_web/example/build.yaml new file mode 100644 index 000000000000..5a89bed84efb --- /dev/null +++ b/packages/url_launcher/url_launcher_web/example/build.yaml @@ -0,0 +1,10 @@ +targets: + $default: + sources: + - integration_test/*.dart + - lib/$lib$ + - $package$ + builders: + mockito|mockBuilder: + generate_for: + - integration_test/** diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart b/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart index 528cff32c0e5..3c27d1c64690 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/link_widget_test.dart @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:html' as html; import 'dart:js_util'; import 'dart:ui_web' as ui_web; @@ -10,7 +11,6 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:url_launcher_platform_interface/link.dart'; import 'package:url_launcher_web/src/link.dart'; -import 'package:web/helpers.dart' as html; void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -174,9 +174,7 @@ void main() { html.Element _findSingleAnchor() { final List foundAnchors = []; - html.NodeList anchors = html.document.querySelectorAll('a'); - for (int i = 0; i < anchors.length; i++) { - final html.Element anchor = anchors.item(i)! as html.Element; + for (final html.Element anchor in html.document.querySelectorAll('a')) { if (hasProperty(anchor, linkViewIdProperty)) { foundAnchors.add(anchor); } @@ -186,9 +184,7 @@ html.Element _findSingleAnchor() { final html.ShadowRoot? shadowRoot = html.document.querySelector('flt-glass-pane')?.shadowRoot; if (shadowRoot != null) { - anchors = shadowRoot.querySelectorAll('a'); - for (int i = 0; i < anchors.length; i++) { - final html.Element anchor = anchors.item(i)! as html.Element; + for (final html.Element anchor in shadowRoot.querySelectorAll('a')) { if (hasProperty(anchor, linkViewIdProperty)) { foundAnchors.add(anchor); } diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart index bce7e136a4e0..994e3b28badf 100644 --- a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart +++ b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.dart @@ -2,31 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:js_interop'; -import 'dart:js_util'; +import 'dart:html' as html; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; -import 'package:mockito/mockito.dart' show any, verify, when, Mock; +import 'package:mockito/annotations.dart'; +import 'package:mockito/mockito.dart'; import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; import 'package:url_launcher_web/url_launcher_web.dart'; -import 'package:web/helpers.dart' as html; -abstract class MyWindow { - html.Window? open(Object? a, Object? b, Object? c); - html.Navigator? get navigator; -} - -@JSExport() -class MockWindow extends Mock implements MyWindow {} - -abstract class MyNavigator { - String? get userAgent; -} - -@JSExport() -class MockNavigator extends Mock implements MyNavigator {} +import 'url_launcher_web_test.mocks.dart'; +@GenerateMocks([html.Window, html.Navigator]) void main() { IntegrationTestWidgetsFlutterBinding.ensureInitialized(); @@ -39,21 +26,15 @@ void main() { setUp(() { mockWindow = MockWindow(); mockNavigator = MockNavigator(); - - final html.Window jsMockWindow = - createDartExport(mockWindow) as html.Window; - final html.Navigator jsMockNavigator = - createDartExport(mockNavigator) as html.Navigator; - - when(mockWindow.navigator).thenReturn(jsMockNavigator); + when(mockWindow.navigator).thenReturn(mockNavigator); // Simulate that window.open does something. - when(mockWindow.open(any, any, any)).thenReturn(jsMockWindow); + when(mockWindow.open(any, any, any)).thenReturn(MockWindow()); when(mockNavigator.userAgent).thenReturn( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'); - plugin = UrlLauncherPlugin(debugWindow: mockWindow as html.Window); + plugin = UrlLauncherPlugin(debugWindow: mockWindow); }); group('canLaunch', () { @@ -62,7 +43,8 @@ void main() { }); testWidgets('"https" URLs -> true', (WidgetTester _) async { - expect(plugin.canLaunch('https://google.com'), completion(isTrue)); + expect( + plugin.canLaunch('https://go, (Widogle.com'), completion(isTrue)); }); testWidgets('"mailto" URLs -> true', (WidgetTester _) async { @@ -185,7 +167,7 @@ void main() { when(mockNavigator.userAgent).thenReturn( 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.5.1 Safari/605.1.15'); // Recreate the plugin, so it grabs the overrides from this group - plugin = UrlLauncherPlugin(debugWindow: mockWindow as html.Window); + plugin = UrlLauncherPlugin(debugWindow: mockWindow); }); testWidgets('http urls should be launched in a new window', diff --git a/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.mocks.dart b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.mocks.dart new file mode 100644 index 000000000000..13ff194eabc9 --- /dev/null +++ b/packages/url_launcher/url_launcher_web/example/integration_test/url_launcher_web_test.mocks.dart @@ -0,0 +1,1512 @@ +// Mocks generated by Mockito 5.4.1 from annotations +// in regular_integration_tests/integration_test/url_launcher_web_test.dart. +// Do not manually edit this file. + +// @dart=2.19 + +// ignore_for_file: no_leading_underscores_for_library_prefixes +import 'dart:async' as _i3; +import 'dart:html' as _i2; +import 'dart:math' as _i4; + +import 'package:mockito/mockito.dart' as _i1; + +// ignore_for_file: type=lint +// ignore_for_file: avoid_redundant_argument_values +// ignore_for_file: avoid_setters_without_getters +// ignore_for_file: comment_references +// ignore_for_file: implementation_imports +// ignore_for_file: invalid_use_of_visible_for_testing_member +// ignore_for_file: prefer_const_constructors +// ignore_for_file: unnecessary_parenthesis +// ignore_for_file: camel_case_types +// ignore_for_file: subtype_of_sealed_class + +class _FakeDocument_0 extends _i1.SmartFake implements _i2.Document { + _FakeDocument_0( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeLocation_1 extends _i1.SmartFake implements _i2.Location { + _FakeLocation_1( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeConsole_2 extends _i1.SmartFake implements _i2.Console { + _FakeConsole_2( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeHistory_3 extends _i1.SmartFake implements _i2.History { + _FakeHistory_3( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeStorage_4 extends _i1.SmartFake implements _i2.Storage { + _FakeStorage_4( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeNavigator_5 extends _i1.SmartFake implements _i2.Navigator { + _FakeNavigator_5( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakePerformance_6 extends _i1.SmartFake implements _i2.Performance { + _FakePerformance_6( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeEvents_7 extends _i1.SmartFake implements _i2.Events { + _FakeEvents_7( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeWindowBase_8 extends _i1.SmartFake implements _i2.WindowBase { + _FakeWindowBase_8( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeFileSystem_9 extends _i1.SmartFake implements _i2.FileSystem { + _FakeFileSystem_9( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeStylePropertyMapReadonly_10 extends _i1.SmartFake + implements _i2.StylePropertyMapReadonly { + _FakeStylePropertyMapReadonly_10( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeMediaQueryList_11 extends _i1.SmartFake + implements _i2.MediaQueryList { + _FakeMediaQueryList_11( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeEntry_12 extends _i1.SmartFake implements _i2.Entry { + _FakeEntry_12( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeGeolocation_13 extends _i1.SmartFake implements _i2.Geolocation { + _FakeGeolocation_13( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeMediaStream_14 extends _i1.SmartFake implements _i2.MediaStream { + _FakeMediaStream_14( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +class _FakeRelatedApplication_15 extends _i1.SmartFake + implements _i2.RelatedApplication { + _FakeRelatedApplication_15( + Object parent, + Invocation parentInvocation, + ) : super( + parent, + parentInvocation, + ); +} + +/// A class which mocks [Window]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockWindow extends _i1.Mock implements _i2.Window { + MockWindow() { + _i1.throwOnMissingStub(this); + } + + @override + _i3.Future get animationFrame => (super.noSuchMethod( + Invocation.getter(#animationFrame), + returnValue: _i3.Future.value(0), + ) as _i3.Future); + + @override + _i2.Document get document => (super.noSuchMethod( + Invocation.getter(#document), + returnValue: _FakeDocument_0( + this, + Invocation.getter(#document), + ), + ) as _i2.Document); + + @override + _i2.Location get location => (super.noSuchMethod( + Invocation.getter(#location), + returnValue: _FakeLocation_1( + this, + Invocation.getter(#location), + ), + ) as _i2.Location); + + @override + set location(_i2.LocationBase? value) => super.noSuchMethod( + Invocation.setter( + #location, + value, + ), + returnValueForMissingStub: null, + ); + + @override + _i2.Console get console => (super.noSuchMethod( + Invocation.getter(#console), + returnValue: _FakeConsole_2( + this, + Invocation.getter(#console), + ), + ) as _i2.Console); + + @override + set defaultStatus(String? value) => super.noSuchMethod( + Invocation.setter( + #defaultStatus, + value, + ), + returnValueForMissingStub: null, + ); + + @override + set defaultstatus(String? value) => super.noSuchMethod( + Invocation.setter( + #defaultstatus, + value, + ), + returnValueForMissingStub: null, + ); + + @override + num get devicePixelRatio => (super.noSuchMethod( + Invocation.getter(#devicePixelRatio), + returnValue: 0, + ) as num); + + @override + _i2.History get history => (super.noSuchMethod( + Invocation.getter(#history), + returnValue: _FakeHistory_3( + this, + Invocation.getter(#history), + ), + ) as _i2.History); + + @override + _i2.Storage get localStorage => (super.noSuchMethod( + Invocation.getter(#localStorage), + returnValue: _FakeStorage_4( + this, + Invocation.getter(#localStorage), + ), + ) as _i2.Storage); + + @override + set name(String? value) => super.noSuchMethod( + Invocation.setter( + #name, + value, + ), + returnValueForMissingStub: null, + ); + + @override + _i2.Navigator get navigator => (super.noSuchMethod( + Invocation.getter(#navigator), + returnValue: _FakeNavigator_5( + this, + Invocation.getter(#navigator), + ), + ) as _i2.Navigator); + + @override + set opener(_i2.WindowBase? value) => super.noSuchMethod( + Invocation.setter( + #opener, + value, + ), + returnValueForMissingStub: null, + ); + + @override + int get outerHeight => (super.noSuchMethod( + Invocation.getter(#outerHeight), + returnValue: 0, + ) as int); + + @override + int get outerWidth => (super.noSuchMethod( + Invocation.getter(#outerWidth), + returnValue: 0, + ) as int); + + @override + _i2.Performance get performance => (super.noSuchMethod( + Invocation.getter(#performance), + returnValue: _FakePerformance_6( + this, + Invocation.getter(#performance), + ), + ) as _i2.Performance); + + @override + _i2.Storage get sessionStorage => (super.noSuchMethod( + Invocation.getter(#sessionStorage), + returnValue: _FakeStorage_4( + this, + Invocation.getter(#sessionStorage), + ), + ) as _i2.Storage); + + @override + set status(String? value) => super.noSuchMethod( + Invocation.setter( + #status, + value, + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Stream<_i2.Event> get onContentLoaded => (super.noSuchMethod( + Invocation.getter(#onContentLoaded), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onAbort => (super.noSuchMethod( + Invocation.getter(#onAbort), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onBlur => (super.noSuchMethod( + Invocation.getter(#onBlur), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onCanPlay => (super.noSuchMethod( + Invocation.getter(#onCanPlay), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onCanPlayThrough => (super.noSuchMethod( + Invocation.getter(#onCanPlayThrough), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onChange => (super.noSuchMethod( + Invocation.getter(#onChange), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.MouseEvent> get onClick => (super.noSuchMethod( + Invocation.getter(#onClick), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onContextMenu => (super.noSuchMethod( + Invocation.getter(#onContextMenu), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.Event> get onDoubleClick => (super.noSuchMethod( + Invocation.getter(#onDoubleClick), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.DeviceMotionEvent> get onDeviceMotion => (super.noSuchMethod( + Invocation.getter(#onDeviceMotion), + returnValue: _i3.Stream<_i2.DeviceMotionEvent>.empty(), + ) as _i3.Stream<_i2.DeviceMotionEvent>); + + @override + _i3.Stream<_i2.DeviceOrientationEvent> get onDeviceOrientation => + (super.noSuchMethod( + Invocation.getter(#onDeviceOrientation), + returnValue: _i3.Stream<_i2.DeviceOrientationEvent>.empty(), + ) as _i3.Stream<_i2.DeviceOrientationEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onDrag => (super.noSuchMethod( + Invocation.getter(#onDrag), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onDragEnd => (super.noSuchMethod( + Invocation.getter(#onDragEnd), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onDragEnter => (super.noSuchMethod( + Invocation.getter(#onDragEnter), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onDragLeave => (super.noSuchMethod( + Invocation.getter(#onDragLeave), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onDragOver => (super.noSuchMethod( + Invocation.getter(#onDragOver), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onDragStart => (super.noSuchMethod( + Invocation.getter(#onDragStart), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onDrop => (super.noSuchMethod( + Invocation.getter(#onDrop), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.Event> get onDurationChange => (super.noSuchMethod( + Invocation.getter(#onDurationChange), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onEmptied => (super.noSuchMethod( + Invocation.getter(#onEmptied), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onEnded => (super.noSuchMethod( + Invocation.getter(#onEnded), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onError => (super.noSuchMethod( + Invocation.getter(#onError), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onFocus => (super.noSuchMethod( + Invocation.getter(#onFocus), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onHashChange => (super.noSuchMethod( + Invocation.getter(#onHashChange), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onInput => (super.noSuchMethod( + Invocation.getter(#onInput), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onInvalid => (super.noSuchMethod( + Invocation.getter(#onInvalid), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.KeyboardEvent> get onKeyDown => (super.noSuchMethod( + Invocation.getter(#onKeyDown), + returnValue: _i3.Stream<_i2.KeyboardEvent>.empty(), + ) as _i3.Stream<_i2.KeyboardEvent>); + + @override + _i3.Stream<_i2.KeyboardEvent> get onKeyPress => (super.noSuchMethod( + Invocation.getter(#onKeyPress), + returnValue: _i3.Stream<_i2.KeyboardEvent>.empty(), + ) as _i3.Stream<_i2.KeyboardEvent>); + + @override + _i3.Stream<_i2.KeyboardEvent> get onKeyUp => (super.noSuchMethod( + Invocation.getter(#onKeyUp), + returnValue: _i3.Stream<_i2.KeyboardEvent>.empty(), + ) as _i3.Stream<_i2.KeyboardEvent>); + + @override + _i3.Stream<_i2.Event> get onLoad => (super.noSuchMethod( + Invocation.getter(#onLoad), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onLoadedData => (super.noSuchMethod( + Invocation.getter(#onLoadedData), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onLoadedMetadata => (super.noSuchMethod( + Invocation.getter(#onLoadedMetadata), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onLoadStart => (super.noSuchMethod( + Invocation.getter(#onLoadStart), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.MessageEvent> get onMessage => (super.noSuchMethod( + Invocation.getter(#onMessage), + returnValue: _i3.Stream<_i2.MessageEvent>.empty(), + ) as _i3.Stream<_i2.MessageEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onMouseDown => (super.noSuchMethod( + Invocation.getter(#onMouseDown), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onMouseEnter => (super.noSuchMethod( + Invocation.getter(#onMouseEnter), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onMouseLeave => (super.noSuchMethod( + Invocation.getter(#onMouseLeave), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onMouseMove => (super.noSuchMethod( + Invocation.getter(#onMouseMove), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onMouseOut => (super.noSuchMethod( + Invocation.getter(#onMouseOut), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onMouseOver => (super.noSuchMethod( + Invocation.getter(#onMouseOver), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.MouseEvent> get onMouseUp => (super.noSuchMethod( + Invocation.getter(#onMouseUp), + returnValue: _i3.Stream<_i2.MouseEvent>.empty(), + ) as _i3.Stream<_i2.MouseEvent>); + + @override + _i3.Stream<_i2.WheelEvent> get onMouseWheel => (super.noSuchMethod( + Invocation.getter(#onMouseWheel), + returnValue: _i3.Stream<_i2.WheelEvent>.empty(), + ) as _i3.Stream<_i2.WheelEvent>); + + @override + _i3.Stream<_i2.Event> get onOffline => (super.noSuchMethod( + Invocation.getter(#onOffline), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onOnline => (super.noSuchMethod( + Invocation.getter(#onOnline), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onPageHide => (super.noSuchMethod( + Invocation.getter(#onPageHide), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onPageShow => (super.noSuchMethod( + Invocation.getter(#onPageShow), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onPause => (super.noSuchMethod( + Invocation.getter(#onPause), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onPlay => (super.noSuchMethod( + Invocation.getter(#onPlay), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onPlaying => (super.noSuchMethod( + Invocation.getter(#onPlaying), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.PopStateEvent> get onPopState => (super.noSuchMethod( + Invocation.getter(#onPopState), + returnValue: _i3.Stream<_i2.PopStateEvent>.empty(), + ) as _i3.Stream<_i2.PopStateEvent>); + + @override + _i3.Stream<_i2.Event> get onProgress => (super.noSuchMethod( + Invocation.getter(#onProgress), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onRateChange => (super.noSuchMethod( + Invocation.getter(#onRateChange), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onReset => (super.noSuchMethod( + Invocation.getter(#onReset), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onResize => (super.noSuchMethod( + Invocation.getter(#onResize), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onScroll => (super.noSuchMethod( + Invocation.getter(#onScroll), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onSearch => (super.noSuchMethod( + Invocation.getter(#onSearch), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onSeeked => (super.noSuchMethod( + Invocation.getter(#onSeeked), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onSeeking => (super.noSuchMethod( + Invocation.getter(#onSeeking), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onSelect => (super.noSuchMethod( + Invocation.getter(#onSelect), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onStalled => (super.noSuchMethod( + Invocation.getter(#onStalled), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.StorageEvent> get onStorage => (super.noSuchMethod( + Invocation.getter(#onStorage), + returnValue: _i3.Stream<_i2.StorageEvent>.empty(), + ) as _i3.Stream<_i2.StorageEvent>); + + @override + _i3.Stream<_i2.Event> get onSubmit => (super.noSuchMethod( + Invocation.getter(#onSubmit), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onSuspend => (super.noSuchMethod( + Invocation.getter(#onSuspend), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onTimeUpdate => (super.noSuchMethod( + Invocation.getter(#onTimeUpdate), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.TouchEvent> get onTouchCancel => (super.noSuchMethod( + Invocation.getter(#onTouchCancel), + returnValue: _i3.Stream<_i2.TouchEvent>.empty(), + ) as _i3.Stream<_i2.TouchEvent>); + + @override + _i3.Stream<_i2.TouchEvent> get onTouchEnd => (super.noSuchMethod( + Invocation.getter(#onTouchEnd), + returnValue: _i3.Stream<_i2.TouchEvent>.empty(), + ) as _i3.Stream<_i2.TouchEvent>); + + @override + _i3.Stream<_i2.TouchEvent> get onTouchMove => (super.noSuchMethod( + Invocation.getter(#onTouchMove), + returnValue: _i3.Stream<_i2.TouchEvent>.empty(), + ) as _i3.Stream<_i2.TouchEvent>); + + @override + _i3.Stream<_i2.TouchEvent> get onTouchStart => (super.noSuchMethod( + Invocation.getter(#onTouchStart), + returnValue: _i3.Stream<_i2.TouchEvent>.empty(), + ) as _i3.Stream<_i2.TouchEvent>); + + @override + _i3.Stream<_i2.TransitionEvent> get onTransitionEnd => (super.noSuchMethod( + Invocation.getter(#onTransitionEnd), + returnValue: _i3.Stream<_i2.TransitionEvent>.empty(), + ) as _i3.Stream<_i2.TransitionEvent>); + + @override + _i3.Stream<_i2.Event> get onUnload => (super.noSuchMethod( + Invocation.getter(#onUnload), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onVolumeChange => (super.noSuchMethod( + Invocation.getter(#onVolumeChange), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.Event> get onWaiting => (super.noSuchMethod( + Invocation.getter(#onWaiting), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.AnimationEvent> get onAnimationEnd => (super.noSuchMethod( + Invocation.getter(#onAnimationEnd), + returnValue: _i3.Stream<_i2.AnimationEvent>.empty(), + ) as _i3.Stream<_i2.AnimationEvent>); + + @override + _i3.Stream<_i2.AnimationEvent> get onAnimationIteration => + (super.noSuchMethod( + Invocation.getter(#onAnimationIteration), + returnValue: _i3.Stream<_i2.AnimationEvent>.empty(), + ) as _i3.Stream<_i2.AnimationEvent>); + + @override + _i3.Stream<_i2.AnimationEvent> get onAnimationStart => (super.noSuchMethod( + Invocation.getter(#onAnimationStart), + returnValue: _i3.Stream<_i2.AnimationEvent>.empty(), + ) as _i3.Stream<_i2.AnimationEvent>); + + @override + _i3.Stream<_i2.Event> get onBeforeUnload => (super.noSuchMethod( + Invocation.getter(#onBeforeUnload), + returnValue: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); + + @override + _i3.Stream<_i2.WheelEvent> get onWheel => (super.noSuchMethod( + Invocation.getter(#onWheel), + returnValue: _i3.Stream<_i2.WheelEvent>.empty(), + ) as _i3.Stream<_i2.WheelEvent>); + + @override + int get pageXOffset => (super.noSuchMethod( + Invocation.getter(#pageXOffset), + returnValue: 0, + ) as int); + + @override + int get pageYOffset => (super.noSuchMethod( + Invocation.getter(#pageYOffset), + returnValue: 0, + ) as int); + + @override + int get scrollX => (super.noSuchMethod( + Invocation.getter(#scrollX), + returnValue: 0, + ) as int); + + @override + int get scrollY => (super.noSuchMethod( + Invocation.getter(#scrollY), + returnValue: 0, + ) as int); + + @override + _i2.Events get on => (super.noSuchMethod( + Invocation.getter(#on), + returnValue: _FakeEvents_7( + this, + Invocation.getter(#on), + ), + ) as _i2.Events); + + @override + _i2.WindowBase open( + String? url, + String? name, [ + String? options, + ]) => + (super.noSuchMethod( + Invocation.method( + #open, + [ + url, + name, + options, + ], + ), + returnValue: _FakeWindowBase_8( + this, + Invocation.method( + #open, + [ + url, + name, + options, + ], + ), + ), + ) as _i2.WindowBase); + + @override + int requestAnimationFrame(_i2.FrameRequestCallback? callback) => + (super.noSuchMethod( + Invocation.method( + #requestAnimationFrame, + [callback], + ), + returnValue: 0, + ) as int); + + @override + void cancelAnimationFrame(int? id) => super.noSuchMethod( + Invocation.method( + #cancelAnimationFrame, + [id], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future<_i2.FileSystem> requestFileSystem( + int? size, { + bool? persistent = false, + }) => + (super.noSuchMethod( + Invocation.method( + #requestFileSystem, + [size], + {#persistent: persistent}, + ), + returnValue: _i3.Future<_i2.FileSystem>.value(_FakeFileSystem_9( + this, + Invocation.method( + #requestFileSystem, + [size], + {#persistent: persistent}, + ), + )), + ) as _i3.Future<_i2.FileSystem>); + + @override + void alert([String? message]) => super.noSuchMethod( + Invocation.method( + #alert, + [message], + ), + returnValueForMissingStub: null, + ); + + @override + void cancelIdleCallback(int? handle) => super.noSuchMethod( + Invocation.method( + #cancelIdleCallback, + [handle], + ), + returnValueForMissingStub: null, + ); + + @override + void close() => super.noSuchMethod( + Invocation.method( + #close, + [], + ), + returnValueForMissingStub: null, + ); + + @override + bool confirm([String? message]) => (super.noSuchMethod( + Invocation.method( + #confirm, + [message], + ), + returnValue: false, + ) as bool); + + @override + _i3.Future fetch( + dynamic input, [ + Map? init, + ]) => + (super.noSuchMethod( + Invocation.method( + #fetch, + [ + input, + init, + ], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + bool find( + String? string, + bool? caseSensitive, + bool? backwards, + bool? wrap, + bool? wholeWord, + bool? searchInFrames, + bool? showDialog, + ) => + (super.noSuchMethod( + Invocation.method( + #find, + [ + string, + caseSensitive, + backwards, + wrap, + wholeWord, + searchInFrames, + showDialog, + ], + ), + returnValue: false, + ) as bool); + + @override + _i2.StylePropertyMapReadonly getComputedStyleMap( + _i2.Element? element, + String? pseudoElement, + ) => + (super.noSuchMethod( + Invocation.method( + #getComputedStyleMap, + [ + element, + pseudoElement, + ], + ), + returnValue: _FakeStylePropertyMapReadonly_10( + this, + Invocation.method( + #getComputedStyleMap, + [ + element, + pseudoElement, + ], + ), + ), + ) as _i2.StylePropertyMapReadonly); + + @override + List<_i2.CssRule> getMatchedCssRules( + _i2.Element? element, + String? pseudoElement, + ) => + (super.noSuchMethod( + Invocation.method( + #getMatchedCssRules, + [ + element, + pseudoElement, + ], + ), + returnValue: <_i2.CssRule>[], + ) as List<_i2.CssRule>); + + @override + _i2.MediaQueryList matchMedia(String? query) => (super.noSuchMethod( + Invocation.method( + #matchMedia, + [query], + ), + returnValue: _FakeMediaQueryList_11( + this, + Invocation.method( + #matchMedia, + [query], + ), + ), + ) as _i2.MediaQueryList); + + @override + void moveBy( + int? x, + int? y, + ) => + super.noSuchMethod( + Invocation.method( + #moveBy, + [ + x, + y, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void postMessage( + dynamic message, + String? targetOrigin, [ + List? transfer, + ]) => + super.noSuchMethod( + Invocation.method( + #postMessage, + [ + message, + targetOrigin, + transfer, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void print() => super.noSuchMethod( + Invocation.method( + #print, + [], + ), + returnValueForMissingStub: null, + ); + + @override + int requestIdleCallback( + _i2.IdleRequestCallback? callback, [ + Map? options, + ]) => + (super.noSuchMethod( + Invocation.method( + #requestIdleCallback, + [ + callback, + options, + ], + ), + returnValue: 0, + ) as int); + + @override + void resizeBy( + int? x, + int? y, + ) => + super.noSuchMethod( + Invocation.method( + #resizeBy, + [ + x, + y, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void resizeTo( + int? x, + int? y, + ) => + super.noSuchMethod( + Invocation.method( + #resizeTo, + [ + x, + y, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void scroll([ + dynamic options_OR_x, + dynamic y, + Map? scrollOptions, + ]) => + super.noSuchMethod( + Invocation.method( + #scroll, + [ + options_OR_x, + y, + scrollOptions, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void scrollBy([ + dynamic options_OR_x, + dynamic y, + Map? scrollOptions, + ]) => + super.noSuchMethod( + Invocation.method( + #scrollBy, + [ + options_OR_x, + y, + scrollOptions, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void scrollTo([ + dynamic options_OR_x, + dynamic y, + Map? scrollOptions, + ]) => + super.noSuchMethod( + Invocation.method( + #scrollTo, + [ + options_OR_x, + y, + scrollOptions, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void stop() => super.noSuchMethod( + Invocation.method( + #stop, + [], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future<_i2.Entry> resolveLocalFileSystemUrl(String? url) => + (super.noSuchMethod( + Invocation.method( + #resolveLocalFileSystemUrl, + [url], + ), + returnValue: _i3.Future<_i2.Entry>.value(_FakeEntry_12( + this, + Invocation.method( + #resolveLocalFileSystemUrl, + [url], + ), + )), + ) as _i3.Future<_i2.Entry>); + + @override + String atob(String? atob) => (super.noSuchMethod( + Invocation.method( + #atob, + [atob], + ), + returnValue: '', + ) as String); + + @override + String btoa(String? btoa) => (super.noSuchMethod( + Invocation.method( + #btoa, + [btoa], + ), + returnValue: '', + ) as String); + + @override + void moveTo(_i4.Point? p) => super.noSuchMethod( + Invocation.method( + #moveTo, + [p], + ), + returnValueForMissingStub: null, + ); + + @override + void addEventListener( + String? type, + _i2.EventListener? listener, [ + bool? useCapture, + ]) => + super.noSuchMethod( + Invocation.method( + #addEventListener, + [ + type, + listener, + useCapture, + ], + ), + returnValueForMissingStub: null, + ); + + @override + void removeEventListener( + String? type, + _i2.EventListener? listener, [ + bool? useCapture, + ]) => + super.noSuchMethod( + Invocation.method( + #removeEventListener, + [ + type, + listener, + useCapture, + ], + ), + returnValueForMissingStub: null, + ); + + @override + bool dispatchEvent(_i2.Event? event) => (super.noSuchMethod( + Invocation.method( + #dispatchEvent, + [event], + ), + returnValue: false, + ) as bool); +} + +/// A class which mocks [Navigator]. +/// +/// See the documentation for Mockito's code generation for more information. +class MockNavigator extends _i1.Mock implements _i2.Navigator { + MockNavigator() { + _i1.throwOnMissingStub(this); + } + + @override + String get language => (super.noSuchMethod( + Invocation.getter(#language), + returnValue: '', + ) as String); + + @override + _i2.Geolocation get geolocation => (super.noSuchMethod( + Invocation.getter(#geolocation), + returnValue: _FakeGeolocation_13( + this, + Invocation.getter(#geolocation), + ), + ) as _i2.Geolocation); + + @override + String get vendor => (super.noSuchMethod( + Invocation.getter(#vendor), + returnValue: '', + ) as String); + + @override + String get vendorSub => (super.noSuchMethod( + Invocation.getter(#vendorSub), + returnValue: '', + ) as String); + + @override + String get appCodeName => (super.noSuchMethod( + Invocation.getter(#appCodeName), + returnValue: '', + ) as String); + + @override + String get appName => (super.noSuchMethod( + Invocation.getter(#appName), + returnValue: '', + ) as String); + + @override + String get appVersion => (super.noSuchMethod( + Invocation.getter(#appVersion), + returnValue: '', + ) as String); + + @override + String get product => (super.noSuchMethod( + Invocation.getter(#product), + returnValue: '', + ) as String); + + @override + String get userAgent => (super.noSuchMethod( + Invocation.getter(#userAgent), + returnValue: '', + ) as String); + + @override + List<_i2.Gamepad?> getGamepads() => (super.noSuchMethod( + Invocation.method( + #getGamepads, + [], + ), + returnValue: <_i2.Gamepad?>[], + ) as List<_i2.Gamepad?>); + + @override + _i3.Future<_i2.MediaStream> getUserMedia({ + dynamic audio = false, + dynamic video = false, + }) => + (super.noSuchMethod( + Invocation.method( + #getUserMedia, + [], + { + #audio: audio, + #video: video, + }, + ), + returnValue: _i3.Future<_i2.MediaStream>.value(_FakeMediaStream_14( + this, + Invocation.method( + #getUserMedia, + [], + { + #audio: audio, + #video: video, + }, + ), + )), + ) as _i3.Future<_i2.MediaStream>); + + @override + void cancelKeyboardLock() => super.noSuchMethod( + Invocation.method( + #cancelKeyboardLock, + [], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future getBattery() => (super.noSuchMethod( + Invocation.method( + #getBattery, + [], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future<_i2.RelatedApplication> getInstalledRelatedApps() => + (super.noSuchMethod( + Invocation.method( + #getInstalledRelatedApps, + [], + ), + returnValue: + _i3.Future<_i2.RelatedApplication>.value(_FakeRelatedApplication_15( + this, + Invocation.method( + #getInstalledRelatedApps, + [], + ), + )), + ) as _i3.Future<_i2.RelatedApplication>); + + @override + _i3.Future getVRDisplays() => (super.noSuchMethod( + Invocation.method( + #getVRDisplays, + [], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + void registerProtocolHandler( + String? scheme, + String? url, + String? title, + ) => + super.noSuchMethod( + Invocation.method( + #registerProtocolHandler, + [ + scheme, + url, + title, + ], + ), + returnValueForMissingStub: null, + ); + + @override + _i3.Future requestKeyboardLock([List? keyCodes]) => + (super.noSuchMethod( + Invocation.method( + #requestKeyboardLock, + [keyCodes], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future requestMidiAccess([Map? options]) => + (super.noSuchMethod( + Invocation.method( + #requestMidiAccess, + [options], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + _i3.Future requestMediaKeySystemAccess( + String? keySystem, + List>? supportedConfigurations, + ) => + (super.noSuchMethod( + Invocation.method( + #requestMediaKeySystemAccess, + [ + keySystem, + supportedConfigurations, + ], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); + + @override + bool sendBeacon( + String? url, + Object? data, + ) => + (super.noSuchMethod( + Invocation.method( + #sendBeacon, + [ + url, + data, + ], + ), + returnValue: false, + ) as bool); + + @override + _i3.Future share([Map? data]) => + (super.noSuchMethod( + Invocation.method( + #share, + [data], + ), + returnValue: _i3.Future.value(), + ) as _i3.Future); +} diff --git a/packages/url_launcher/url_launcher_web/example/pubspec.yaml b/packages/url_launcher/url_launcher_web/example/pubspec.yaml index eacab085af02..d0964233150f 100644 --- a/packages/url_launcher/url_launcher_web/example/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/example/pubspec.yaml @@ -2,20 +2,20 @@ name: regular_integration_tests publish_to: none environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" dependencies: flutter: sdk: flutter dev_dependencies: + build_runner: ^2.1.1 flutter_test: sdk: flutter integration_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 url_launcher_platform_interface: ^2.2.0 url_launcher_web: path: ../ - web: '>=0.3.0 <0.5.0' diff --git a/packages/url_launcher/url_launcher_web/lib/src/link.dart b/packages/url_launcher/url_launcher_web/lib/src/link.dart index b2217fafb805..b1589ba88991 100644 --- a/packages/url_launcher/url_launcher_web/lib/src/link.dart +++ b/packages/url_launcher/url_launcher_web/lib/src/link.dart @@ -3,6 +3,7 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:html' as html; import 'dart:js_util'; import 'dart:ui_web' as ui_web; @@ -12,7 +13,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:url_launcher_platform_interface/link.dart'; -import 'package:web/helpers.dart' as html; /// The unique identifier for the view type to be used for link platform views. const String linkViewType = '__url_launcher::link'; @@ -104,11 +104,7 @@ class LinkViewController extends PlatformViewController { if (_instances.isEmpty) { // This is the first controller being created, attach the global click // listener. - - _clickSubscription = - const html.EventStreamProvider('click') - .forTarget(html.window) - .listen(_onGlobalClick); + _clickSubscription = html.window.onClick.listen(_onGlobalClick); } _instances[viewId] = this; } @@ -168,10 +164,10 @@ class LinkViewController extends PlatformViewController { @override final int viewId; - late html.HTMLElement _element; + late html.Element _element; Future _initialize() async { - _element = html.document.createElement('a') as html.HTMLElement; + _element = html.Element.tag('a'); setProperty(_element, linkViewIdProperty, viewId); _element.style ..opacity = '0' diff --git a/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart b/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart index 070852db4c3e..0dd1012f708c 100644 --- a/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart +++ b/packages/url_launcher/url_launcher_web/lib/url_launcher_web.dart @@ -3,13 +3,13 @@ // found in the LICENSE file. import 'dart:async'; +import 'dart:html' as html; import 'dart:ui_web' as ui_web; import 'package:flutter/foundation.dart' show kDebugMode, visibleForTesting; import 'package:flutter_web_plugins/flutter_web_plugins.dart' show Registrar; import 'package:url_launcher_platform_interface/link.dart'; import 'package:url_launcher_platform_interface/url_launcher_platform_interface.dart'; -import 'package:web/web.dart' as html; import 'src/link.dart'; @@ -68,7 +68,7 @@ class UrlLauncherPlugin extends UrlLauncherPlatform { /// /// Returns the newly created window. @visibleForTesting - html.Window? openNewWindow(String url, {String? webOnlyWindowName}) { + html.WindowBase? openNewWindow(String url, {String? webOnlyWindowName}) { final String? scheme = _getUrlScheme(url); // Actively disallow opening some schemes, like javascript. // See https://github.com/flutter/flutter/issues/136657 diff --git a/packages/url_launcher/url_launcher_web/pubspec.yaml b/packages/url_launcher/url_launcher_web/pubspec.yaml index 371c534a20de..b70a09439e77 100644 --- a/packages/url_launcher/url_launcher_web/pubspec.yaml +++ b/packages/url_launcher/url_launcher_web/pubspec.yaml @@ -2,11 +2,11 @@ name: url_launcher_web description: Web platform implementation of url_launcher repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_web issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 2.2.2 +version: 2.2.0 environment: - sdk: ^3.2.0 - flutter: ">=3.16.0" + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" flutter: plugin: @@ -22,7 +22,6 @@ dependencies: flutter_web_plugins: sdk: flutter url_launcher_platform_interface: ^2.2.0 - web: '>=0.3.0 <0.5.0' dev_dependencies: flutter_test: diff --git a/packages/url_launcher/url_launcher_windows/CHANGELOG.md b/packages/url_launcher/url_launcher_windows/CHANGELOG.md index 478fe88e240e..67dc94ef51d2 100644 --- a/packages/url_launcher/url_launcher_windows/CHANGELOG.md +++ b/packages/url_launcher/url_launcher_windows/CHANGELOG.md @@ -1,6 +1,5 @@ -## 3.1.1 +## NEXT -* Updates `launchUrl` to return false instead of throwing when there is no handler. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 3.1.0 diff --git a/packages/url_launcher/url_launcher_windows/lib/src/messages.g.dart b/packages/url_launcher/url_launcher_windows/lib/src/messages.g.dart index 2d84f683abac..10034231b5f6 100644 --- a/packages/url_launcher/url_launcher_windows/lib/src/messages.g.dart +++ b/packages/url_launcher/url_launcher_windows/lib/src/messages.g.dart @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v13.0.0), do not edit directly. +// Autogenerated from Pigeon (v10.1.2), do not edit directly. // See also: https://pub.dev/packages/pigeon // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import @@ -11,17 +11,6 @@ import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; import 'package:flutter/services.dart'; -List wrapResponse( - {Object? result, PlatformException? error, bool empty = false}) { - if (empty) { - return []; - } - if (error == null) { - return [result]; - } - return [error.code, error.message, error.details]; -} - class UrlLauncherApi { /// Constructor for [UrlLauncherApi]. The [binaryMessenger] named argument is /// available for dependency injection. If it is left null, the default @@ -34,8 +23,7 @@ class UrlLauncherApi { Future canLaunchUrl(String arg_url) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.canLaunchUrl', - codec, + 'dev.flutter.pigeon.UrlLauncherApi.canLaunchUrl', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_url]) as List?; @@ -60,10 +48,9 @@ class UrlLauncherApi { } } - Future launchUrl(String arg_url) async { + Future launchUrl(String arg_url) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.launchUrl', - codec, + 'dev.flutter.pigeon.UrlLauncherApi.launchUrl', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_url]) as List?; @@ -78,13 +65,8 @@ class UrlLauncherApi { message: replyList[1] as String?, details: replyList[2], ); - } else if (replyList[0] == null) { - throw PlatformException( - code: 'null-error', - message: 'Host platform returned null value for non-null return value.', - ); } else { - return (replyList[0] as bool?)!; + return; } } } diff --git a/packages/url_launcher/url_launcher_windows/lib/url_launcher_windows.dart b/packages/url_launcher/url_launcher_windows/lib/url_launcher_windows.dart index 8ba77dc391a0..790a45149be8 100644 --- a/packages/url_launcher/url_launcher_windows/lib/url_launcher_windows.dart +++ b/packages/url_launcher/url_launcher_windows/lib/url_launcher_windows.dart @@ -41,7 +41,9 @@ class UrlLauncherWindows extends UrlLauncherPlatform { required Map headers, String? webOnlyWindowName, }) async { - return _hostApi.launchUrl(url); + await _hostApi.launchUrl(url); + // Failure is handled via a PlatformException from `launchUrl`. + return true; } @override diff --git a/packages/url_launcher/url_launcher_windows/pigeons/messages.dart b/packages/url_launcher/url_launcher_windows/pigeons/messages.dart index 28152e45b888..9607cdffc686 100644 --- a/packages/url_launcher/url_launcher_windows/pigeons/messages.dart +++ b/packages/url_launcher/url_launcher_windows/pigeons/messages.dart @@ -14,5 +14,5 @@ import 'package:pigeon/pigeon.dart'; @HostApi(dartHostTestHandler: 'TestUrlLauncherApi') abstract class UrlLauncherApi { bool canLaunchUrl(String url); - bool launchUrl(String url); + void launchUrl(String url); } diff --git a/packages/url_launcher/url_launcher_windows/pubspec.yaml b/packages/url_launcher/url_launcher_windows/pubspec.yaml index 098645490871..9e8fb2cb631e 100644 --- a/packages/url_launcher/url_launcher_windows/pubspec.yaml +++ b/packages/url_launcher/url_launcher_windows/pubspec.yaml @@ -2,7 +2,7 @@ name: url_launcher_windows description: Windows implementation of the url_launcher plugin. repository: https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher_windows issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+url_launcher%22 -version: 3.1.1 +version: 3.1.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -24,7 +24,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - pigeon: ^13.0.0 + pigeon: ^10.1.2 test: ^1.16.3 topics: diff --git a/packages/url_launcher/url_launcher_windows/test/url_launcher_windows_test.dart b/packages/url_launcher/url_launcher_windows/test/url_launcher_windows_test.dart index 5d8efc0316bb..0be939bad19b 100644 --- a/packages/url_launcher/url_launcher_windows/test/url_launcher_windows_test.dart +++ b/packages/url_launcher/url_launcher_windows/test/url_launcher_windows_test.dart @@ -47,7 +47,7 @@ void main() { api.canLaunch = true; expect( - await plugin.launch( + plugin.launch( 'http://example.com/', useSafariVC: true, useWebView: false, @@ -56,30 +56,13 @@ void main() { universalLinksOnly: false, headers: const {}, ), - true); + completes); expect(api.argument, 'http://example.com/'); }); test('handles failure', () async { api.canLaunch = false; - expect( - await plugin.launch( - 'http://example.com/', - useSafariVC: true, - useWebView: false, - enableJavaScript: false, - enableDomStorage: false, - universalLinksOnly: false, - headers: const {}, - ), - false); - expect(api.argument, 'http://example.com/'); - }); - - test('handles errors', () async { - api.throwError = true; - await expectLater( plugin.launch( 'http://example.com/', @@ -139,15 +122,12 @@ class _FakeUrlLauncherApi implements UrlLauncherApi { /// The argument that was passed to an API call. String? argument; - /// Controls the behavior of the fake canLaunch implementations. + /// Controls the behavior of the fake implementations. /// /// - [canLaunchUrl] returns this value. - /// - [launchUrl] returns this value if [throwError] is false. + /// - [launchUrl] throws if this is false. bool canLaunch = false; - /// Whether to throw a platform exception. - bool throwError = false; - @override Future canLaunchUrl(String url) async { argument = url; @@ -155,11 +135,10 @@ class _FakeUrlLauncherApi implements UrlLauncherApi { } @override - Future launchUrl(String url) async { + Future launchUrl(String url) async { argument = url; - if (throwError) { + if (!canLaunch) { throw PlatformException(code: 'Failed'); } - return canLaunch; } } diff --git a/packages/url_launcher/url_launcher_windows/windows/messages.g.cpp b/packages/url_launcher/url_launcher_windows/windows/messages.g.cpp index 43c6254a2a44..95f166821b5d 100644 --- a/packages/url_launcher/url_launcher_windows/windows/messages.g.cpp +++ b/packages/url_launcher/url_launcher_windows/windows/messages.g.cpp @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v13.0.0), do not edit directly. +// Autogenerated from Pigeon (v10.1.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #undef _HAS_EXCEPTIONS @@ -36,8 +36,7 @@ void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger, UrlLauncherApi* api) { { auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.canLaunchUrl", + binary_messenger, "dev.flutter.pigeon.UrlLauncherApi.canLaunchUrl", &GetCodec()); if (api != nullptr) { channel->SetMessageHandler( @@ -69,8 +68,7 @@ void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger, } { auto channel = std::make_unique>( - binary_messenger, - "dev.flutter.pigeon.url_launcher_windows.UrlLauncherApi.launchUrl", + binary_messenger, "dev.flutter.pigeon.UrlLauncherApi.launchUrl", &GetCodec()); if (api != nullptr) { channel->SetMessageHandler( @@ -84,13 +82,13 @@ void UrlLauncherApi::SetUp(flutter::BinaryMessenger* binary_messenger, return; } const auto& url_arg = std::get(encodable_url_arg); - ErrorOr output = api->LaunchUrl(url_arg); - if (output.has_error()) { - reply(WrapError(output.error())); + std::optional output = api->LaunchUrl(url_arg); + if (output.has_value()) { + reply(WrapError(output.value())); return; } EncodableList wrapped; - wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + wrapped.push_back(EncodableValue()); reply(EncodableValue(std::move(wrapped))); } catch (const std::exception& exception) { reply(WrapError(exception.what())); diff --git a/packages/url_launcher/url_launcher_windows/windows/messages.g.h b/packages/url_launcher/url_launcher_windows/windows/messages.g.h index f725b019aad0..52407bf4c8db 100644 --- a/packages/url_launcher/url_launcher_windows/windows/messages.g.h +++ b/packages/url_launcher/url_launcher_windows/windows/messages.g.h @@ -1,7 +1,7 @@ // Copyright 2013 The Flutter Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Autogenerated from Pigeon (v13.0.0), do not edit directly. +// Autogenerated from Pigeon (v10.1.2), do not edit directly. // See also: https://pub.dev/packages/pigeon #ifndef PIGEON_MESSAGES_G_H_ @@ -66,7 +66,7 @@ class UrlLauncherApi { UrlLauncherApi& operator=(const UrlLauncherApi&) = delete; virtual ~UrlLauncherApi() {} virtual ErrorOr CanLaunchUrl(const std::string& url) = 0; - virtual ErrorOr LaunchUrl(const std::string& url) = 0; + virtual std::optional LaunchUrl(const std::string& url) = 0; // The codec used by UrlLauncherApi. static const flutter::StandardMessageCodec& GetCodec(); diff --git a/packages/url_launcher/url_launcher_windows/windows/test/url_launcher_windows_test.cpp b/packages/url_launcher/url_launcher_windows/windows/test/url_launcher_windows_test.cpp index 267295740006..9dd2be5347b5 100644 --- a/packages/url_launcher/url_launcher_windows/windows/test/url_launcher_windows_test.cpp +++ b/packages/url_launcher/url_launcher_windows/windows/test/url_launcher_windows_test.cpp @@ -94,7 +94,7 @@ TEST(UrlLauncherPlugin, CanLaunchHandlesOpenFailure) { EXPECT_FALSE(result.value()); } -TEST(UrlLauncherPlugin, LaunchReportsSuccess) { +TEST(UrlLauncherPlugin, LaunchSuccess) { std::unique_ptr system = std::make_unique(); // Return a success value (>32) from launching. @@ -102,37 +102,22 @@ TEST(UrlLauncherPlugin, LaunchReportsSuccess) { .WillOnce(Return(reinterpret_cast(33))); UrlLauncherPlugin plugin(std::move(system)); - ErrorOr result = plugin.LaunchUrl("https://some.url.com"); + std::optional error = plugin.LaunchUrl("https://some.url.com"); - ASSERT_FALSE(result.has_error()); - EXPECT_TRUE(result.value()); + EXPECT_FALSE(error.has_value()); } TEST(UrlLauncherPlugin, LaunchReportsFailure) { std::unique_ptr system = std::make_unique(); - // Return error 31 from launching, indicating no handler. - EXPECT_CALL(*system, ShellExecuteW) - .WillOnce(Return(reinterpret_cast(SE_ERR_NOASSOC))); - - UrlLauncherPlugin plugin(std::move(system)); - ErrorOr result = plugin.LaunchUrl("https://some.url.com"); - - ASSERT_FALSE(result.has_error()); - EXPECT_FALSE(result.value()); -} - -TEST(UrlLauncherPlugin, LaunchReportsError) { - std::unique_ptr system = std::make_unique(); - - // Return a failure value (<=32) from launching. + // Return a faile value (<=32) from launching. EXPECT_CALL(*system, ShellExecuteW) .WillOnce(Return(reinterpret_cast(32))); UrlLauncherPlugin plugin(std::move(system)); - ErrorOr result = plugin.LaunchUrl("https://some.url.com"); + std::optional error = plugin.LaunchUrl("https://some.url.com"); - EXPECT_TRUE(result.has_error()); + EXPECT_TRUE(error.has_value()); } } // namespace test diff --git a/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp b/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp index c8e7b2f516cb..1dfee16c4445 100644 --- a/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp +++ b/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.cpp @@ -97,7 +97,8 @@ ErrorOr UrlLauncherPlugin::CanLaunchUrl(const std::string& url) { return has_handler; } -ErrorOr UrlLauncherPlugin::LaunchUrl(const std::string& url) { +std::optional UrlLauncherPlugin::LaunchUrl( + const std::string& url) { std::wstring url_wide = Utf16FromUtf8(url); int status = static_cast(reinterpret_cast( @@ -106,18 +107,12 @@ ErrorOr UrlLauncherPlugin::LaunchUrl(const std::string& url) { // Per ::ShellExecuteW documentation, anything >32 indicates success. if (status <= 32) { - if (status == SE_ERR_NOASSOC) { - // NOASSOC just means there's nothing registered to handle launching; - // return false rather than an error for better consistency with other - // platforms. - return false; - } std::ostringstream error_message; error_message << "Failed to open " << url << ": ShellExecute error code " << status; return FlutterError("open_error", error_message.str()); } - return true; + return std::nullopt; } } // namespace url_launcher_windows diff --git a/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.h b/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.h index 5250c191d581..e51cde67ab79 100644 --- a/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.h +++ b/packages/url_launcher/url_launcher_windows/windows/url_launcher_plugin.h @@ -34,7 +34,7 @@ class UrlLauncherPlugin : public flutter::Plugin, public UrlLauncherApi { // UrlLauncherApi: ErrorOr CanLaunchUrl(const std::string& url) override; - ErrorOr LaunchUrl(const std::string& url) override; + std::optional LaunchUrl(const std::string& url) override; private: std::unique_ptr system_apis_; diff --git a/packages/video_player/video_player/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/video_player/video_player/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/video_player/video_player/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/video_player/video_player/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/video_player/video_player/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/video_player/video_player/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/video_player/video_player/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/video_player/video_player/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/video_player/video_player_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/video_player/video_player_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/video_player/video_player_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/video_player/video_player_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/video_player/video_player_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/video_player/video_player_android/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/video_player/video_player_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/video_player/video_player_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/video_player/video_player_avfoundation/CHANGELOG.md b/packages/video_player/video_player_avfoundation/CHANGELOG.md index 23316e06354a..e9c2bccc1591 100644 --- a/packages/video_player/video_player_avfoundation/CHANGELOG.md +++ b/packages/video_player/video_player_avfoundation/CHANGELOG.md @@ -1,7 +1,3 @@ -## 2.5.3 - -* Publishes an instance of the plugin to the registrar on macOS, as on iOS. - ## 2.5.2 * Fixes flickering and seek-while-paused on macOS. diff --git a/packages/video_player/video_player_avfoundation/darwin/Classes/FVPVideoPlayerPlugin.m b/packages/video_player/video_player_avfoundation/darwin/Classes/FVPVideoPlayerPlugin.m index 654c63fc2b67..bece3f3ca9ae 100644 --- a/packages/video_player/video_player_avfoundation/darwin/Classes/FVPVideoPlayerPlugin.m +++ b/packages/video_player/video_player_avfoundation/darwin/Classes/FVPVideoPlayerPlugin.m @@ -666,7 +666,11 @@ @interface FVPVideoPlayerPlugin () @implementation FVPVideoPlayerPlugin + (void)registerWithRegistrar:(NSObject *)registrar { FVPVideoPlayerPlugin *instance = [[FVPVideoPlayerPlugin alloc] initWithRegistrar:registrar]; +#if !TARGET_OS_OSX + // TODO(stuartmorgan): Remove the ifdef once >3.13 reaches stable. See + // https://github.com/flutter/flutter/issues/135320 [registrar publish:instance]; +#endif SetUpFVPAVFoundationVideoPlayerApi(registrar.messenger, instance); } diff --git a/packages/video_player/video_player_avfoundation/darwin/RunnerTests/VideoPlayerTests.m b/packages/video_player/video_player_avfoundation/darwin/RunnerTests/VideoPlayerTests.m index bebcb71885fe..00836192a5f1 100644 --- a/packages/video_player/video_player_avfoundation/darwin/RunnerTests/VideoPlayerTests.m +++ b/packages/video_player/video_player_avfoundation/darwin/RunnerTests/VideoPlayerTests.m @@ -691,19 +691,6 @@ - (void)testHotReloadDoesNotCrash { handler:nil]; // No assertions needed. Lack of crash is a success. } -- (void)testPublishesInRegistration { - NSString *pluginKey = @"TestRegistration"; - NSObject *registry = GetPluginRegistry(); - NSObject *registrar = [registry registrarForPlugin:pluginKey]; - - [FVPVideoPlayerPlugin registerWithRegistrar:registrar]; - - id publishedValue = [registry valuePublishedByPlugin:pluginKey]; - - XCTAssertNotNil(publishedValue); - XCTAssertTrue([publishedValue isKindOfClass:[FVPVideoPlayerPlugin class]]); -} - #if TARGET_OS_IOS - (void)validateTransformFixForOrientation:(UIImageOrientation)orientation { AVAssetTrack *track = [[FakeAVAssetTrack alloc] initWithOrientation:orientation]; diff --git a/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.pbxproj b/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.pbxproj index 4a5c59db31f4..0fb67b609543 100644 --- a/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.pbxproj @@ -110,12 +110,12 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 330B3F8E2B1F9C6A00E6DC3F /* RunnerTests */ = { + 331C80D6294CF71000263BE5 /* RunnerTests */ = { isa = PBXGroup; children = ( 33683FF02ABCAC94007305E4 /* VideoPlayerTests.m */, ); - name = RunnerTests; + path = RunnerTests; sourceTree = ""; }; 33BA886A226E78AF003329D5 /* Configs */ = { @@ -134,7 +134,7 @@ children = ( 33FAB671232836740065AC1E /* Runner */, 33CEB47122A05771004F2AC0 /* Flutter */, - 330B3F8E2B1F9C6A00E6DC3F /* RunnerTests */, + 331C80D6294CF71000263BE5 /* RunnerTests */, 33CC10EE2044A3C60003C045 /* Products */, D73912EC22F37F3D000D13A0 /* Frameworks */, 628924301D1755B9EF85E51F /* Pods */, diff --git a/packages/video_player/video_player_avfoundation/pubspec.yaml b/packages/video_player/video_player_avfoundation/pubspec.yaml index 76a32f0a293f..e10c729efa1a 100644 --- a/packages/video_player/video_player_avfoundation/pubspec.yaml +++ b/packages/video_player/video_player_avfoundation/pubspec.yaml @@ -2,11 +2,11 @@ name: video_player_avfoundation description: iOS and macOS implementation of the video_player plugin. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.5.3 +version: 2.5.2 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ">=3.1.0 <4.0.0" + flutter: ">=3.13.0" flutter: plugin: diff --git a/packages/web_benchmarks/CHANGELOG.md b/packages/web_benchmarks/CHANGELOG.md index 5641ddfb3ab4..e5da41293b4c 100644 --- a/packages/web_benchmarks/CHANGELOG.md +++ b/packages/web_benchmarks/CHANGELOG.md @@ -1,33 +1,6 @@ -## 1.1.0 - -* Adds `computeAverage` and `computeDelta` methods to support analysis of benchmark results. - -## 1.0.1 - -* Adds `parse` constructors for the `BenchmarkResults` and `BenchmarkScore` classes. - -## 1.0.0 - -* **Breaking change:** replace the `useCanvasKit` parameter in the `serveWebBenchmark` -method with a new parameter `compilationOptions`, which allows you to: - * specify the web renderer to use for the benchmark app (html, canvaskit, or skwasm) - * specify whether to use WebAssembly to build the benchmark app -* **Breaking change:** `serveWebBenchmark` now uses `canvaskit` instead of `html` as the -default web renderer. - -## 0.1.0+11 - -* Migrates benchmark recorder from `dart:html` to `package:web` to support WebAssembly. - -## 0.1.0+10 - -* Ensure the benchmark client reloads with the proper `initialPage`. -* Migrates benchmark recorder away from deprecated `js_util` APIs. - -## 0.1.0+9 +## NEXT * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. -* Adds an optional parameter `initialPage` to `serveWebBenchmark`. ## 0.1.0+8 diff --git a/packages/web_benchmarks/README.md b/packages/web_benchmarks/README.md index ce98a22b194a..cc38fc92cea9 100644 --- a/packages/web_benchmarks/README.md +++ b/packages/web_benchmarks/README.md @@ -13,45 +13,3 @@ app's code and assets. Additionally, the server communicates with the browser to extract the performance traces. [1]: https://github.com/flutter/packages/blob/master/packages/web_benchmarks/testing/web_benchmarks_test.dart - -# Analyzing benchmark results - -After running web benchmarks, you may want to analyze the results or compare -with the results from other benchmark runs. The `web_benchmarks` package -supports the following analysis operations: - -* compute the delta between two benchmark results -* compute the average of a set of benchmark results - - -```dart -import 'dart:convert'; -import 'dart:io'; - -import 'package:web_benchmarks/analysis.dart'; - -void main() { - final BenchmarkResults baselineResults = - _benchmarkResultsFromFile('/path/to/benchmark_baseline.json'); - final BenchmarkResults testResults1 = - _benchmarkResultsFromFile('/path/to/benchmark_test_1.json'); - final BenchmarkResults testResults2 = - _benchmarkResultsFromFile('/path/to/benchmark_test_2.json'); - - // Compute the delta between [baselineResults] and [testResults1]. - final BenchmarkResults delta = computeDelta(baselineResults, testResults1); - stdout.writeln(delta.toJson()); - - // Compute the average of [testResults] and [testResults2]. - final BenchmarkResults average = - computeAverage([testResults1, testResults2]); - stdout.writeln(average.toJson()); -} - -BenchmarkResults _benchmarkResultsFromFile(String path) { - final File file = File.fromUri(Uri.parse(path)); - final Map fileContentAsJson = - jsonDecode(file.readAsStringSync()) as Map; - return BenchmarkResults.parse(fileContentAsJson); -} -``` diff --git a/packages/web_benchmarks/example/analyze_example.dart b/packages/web_benchmarks/example/analyze_example.dart deleted file mode 100644 index bf2721ac594a..000000000000 --- a/packages/web_benchmarks/example/analyze_example.dart +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// #docregion analyze -import 'dart:convert'; -import 'dart:io'; - -import 'package:web_benchmarks/analysis.dart'; - -void main() { - final BenchmarkResults baselineResults = - _benchmarkResultsFromFile('/path/to/benchmark_baseline.json'); - final BenchmarkResults testResults1 = - _benchmarkResultsFromFile('/path/to/benchmark_test_1.json'); - final BenchmarkResults testResults2 = - _benchmarkResultsFromFile('/path/to/benchmark_test_2.json'); - - // Compute the delta between [baselineResults] and [testResults1]. - final BenchmarkResults delta = computeDelta(baselineResults, testResults1); - stdout.writeln(delta.toJson()); - - // Compute the average of [testResults] and [testResults2]. - final BenchmarkResults average = - computeAverage([testResults1, testResults2]); - stdout.writeln(average.toJson()); -} - -BenchmarkResults _benchmarkResultsFromFile(String path) { - final File file = File.fromUri(Uri.parse(path)); - final Map fileContentAsJson = - jsonDecode(file.readAsStringSync()) as Map; - return BenchmarkResults.parse(fileContentAsJson); -} -// #enddocregion analyze diff --git a/packages/web_benchmarks/lib/analysis.dart b/packages/web_benchmarks/lib/analysis.dart deleted file mode 100644 index 73b5d6e78c52..000000000000 --- a/packages/web_benchmarks/lib/analysis.dart +++ /dev/null @@ -1,121 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:collection/collection.dart'; -import 'server.dart'; - -export 'src/benchmark_result.dart'; - -/// Returns the average of the benchmark results in [results]. -/// -/// Each element in [results] is expected to have identical benchmark names and -/// metrics; otherwise, an [Exception] will be thrown. -BenchmarkResults computeAverage(List results) { - if (results.isEmpty) { - throw ArgumentError('Cannot take average of empty list.'); - } - - final BenchmarkResults totalSum = results.reduce( - (BenchmarkResults sum, BenchmarkResults next) => sum._sumWith(next), - ); - - final BenchmarkResults average = totalSum; - for (final String benchmark in totalSum.scores.keys) { - final List scoresForBenchmark = totalSum.scores[benchmark]!; - for (int i = 0; i < scoresForBenchmark.length; i++) { - final BenchmarkScore score = scoresForBenchmark[i]; - final double averageValue = score.value / results.length; - average.scores[benchmark]![i] = - BenchmarkScore(metric: score.metric, value: averageValue); - } - } - return average; -} - -/// Computes the delta for each matching metric in [test] and [baseline], and -/// returns a new [BenchmarkResults] object where each [BenchmarkScore] contains -/// a [delta] value. -BenchmarkResults computeDelta( - BenchmarkResults baseline, - BenchmarkResults test, -) { - final Map> delta = - >{}; - for (final String benchmarkName in test.scores.keys) { - final List testScores = test.scores[benchmarkName]!; - final List? baselineScores = baseline.scores[benchmarkName]; - delta[benchmarkName] = testScores.map( - (BenchmarkScore testScore) { - final BenchmarkScore? baselineScore = baselineScores?.firstWhereOrNull( - (BenchmarkScore s) => s.metric == testScore.metric); - return testScore._copyWith( - delta: baselineScore == null - ? null - : (testScore.value - baselineScore.value).toDouble(), - ); - }, - ).toList(); - } - return BenchmarkResults(delta); -} - -extension _AnalysisExtension on BenchmarkResults { - /// Sums this [BenchmarkResults] instance with [other] by adding the values - /// of each matching benchmark score. - /// - /// Returns a [BenchmarkResults] object with the summed values. - /// - /// When [throwExceptionOnMismatch] is true (default), the set of benchmark - /// names and metric names in [other] are expected to be identical to those in - /// [scores], or else an [Exception] will be thrown. - BenchmarkResults _sumWith( - BenchmarkResults other, { - bool throwExceptionOnMismatch = true, - }) { - final Map> sum = - >{}; - for (final String benchmark in scores.keys) { - // Look up this benchmark in [other]. - final List? matchingBenchmark = other.scores[benchmark]; - if (matchingBenchmark == null) { - if (throwExceptionOnMismatch) { - throw Exception( - 'Cannot sum benchmarks because [other] is missing an entry for ' - 'benchmark "$benchmark".', - ); - } - continue; - } - - final List scoresForBenchmark = scores[benchmark]!; - sum[benchmark] = - scoresForBenchmark.map((BenchmarkScore score) { - // Look up this score in the [matchingBenchmark] from [other]. - final BenchmarkScore? matchingScore = matchingBenchmark - .firstWhereOrNull((BenchmarkScore s) => s.metric == score.metric); - if (matchingScore == null && throwExceptionOnMismatch) { - throw Exception( - 'Cannot sum benchmarks because benchmark "$benchmark" is missing ' - 'a score for metric ${score.metric}.', - ); - } - return score._copyWith( - value: matchingScore == null - ? score.value - : score.value + matchingScore.value, - ); - }).toList(); - } - return BenchmarkResults(sum); - } -} - -extension _CopyExtension on BenchmarkScore { - BenchmarkScore _copyWith({String? metric, num? value, num? delta}) => - BenchmarkScore( - metric: metric ?? this.metric, - value: value ?? this.value, - delta: delta ?? this.delta, - ); -} diff --git a/packages/web_benchmarks/lib/client.dart b/packages/web_benchmarks/lib/client.dart index baaab84fe504..43ef711918cd 100644 --- a/packages/web_benchmarks/lib/client.dart +++ b/packages/web_benchmarks/lib/client.dart @@ -4,14 +4,11 @@ import 'dart:async'; import 'dart:convert' show json; -import 'dart:js_interop'; +import 'dart:html' as html; import 'dart:math' as math; -import 'package:web/helpers.dart'; - import 'src/common.dart'; import 'src/recorder.dart'; - export 'src/recorder.dart'; /// Signature for a function that creates a [Recorder]. @@ -32,10 +29,7 @@ final LocalBenchmarkServerClient _client = LocalBenchmarkServerClient(); /// /// When used without a server, prompts the user to select a benchmark to /// run next. -Future runBenchmarks( - Map benchmarks, { - String initialPage = defaultInitialPage, -}) async { +Future runBenchmarks(Map benchmarks) async { // Set local benchmarks. _benchmarks = benchmarks; @@ -49,22 +43,7 @@ Future runBenchmarks( } await _runBenchmark(nextBenchmark); - - final Uri currentUri = Uri.parse(window.location.href); - // Create a new URI with the current 'page' value set to [initialPage] to - // ensure the benchmark app is reloaded at the proper location. - final String newUri = Uri( - scheme: currentUri.scheme, - host: currentUri.host, - port: currentUri.port, - path: initialPage, - ).toString(); - - // Reloading the window will trigger the next benchmark to run. - await _client.printToConsole( - 'Client preparing to reload the window to: "$newUri"', - ); - window.location.replace(newUri); + html.window.location.reload(); } Future _runBenchmark(String? benchmarkName) async { @@ -122,7 +101,7 @@ Future _runBenchmark(String? benchmarkName) async { } void _fallbackToManual(String error) { - document.body!.appendHtml(''' + html.document.body!.appendHtml('''

$error

@@ -133,33 +112,33 @@ void _fallbackToManual(String error) { ${_benchmarks.keys.map((String name) => '
  • ').join('\n')}
    - '''); + ''', + validator: html.NodeValidatorBuilder() + ..allowHtml5() + ..allowInlineStyles()); for (final String benchmarkName in _benchmarks.keys) { // Find the button elements added above. - final Element button = document.querySelector('#$benchmarkName')!; - button.addEventListener( - 'click', - (JSAny? arg) { - final Element? manualPanel = document.querySelector('#manual-panel'); - manualPanel?.remove(); - _runBenchmark(benchmarkName); - }.toJS); + final html.Element button = html.document.querySelector('#$benchmarkName')!; + button.addEventListener('click', (_) { + final html.Element? manualPanel = + html.document.querySelector('#manual-panel'); + manualPanel?.remove(); + _runBenchmark(benchmarkName); + }); } } /// Visualizes results on the Web page for manual inspection. void _printResultsToScreen(Profile profile) { - final HTMLBodyElement body = document.body! as HTMLBodyElement; + final html.BodyElement body = html.document.body!; - body.innerHTML = '

    ${profile.name}

    '; + body.innerHtml = '

    ${profile.name}

    '; profile.scoreData.forEach((String scoreKey, Timeseries timeseries) { body.appendHtml('

    $scoreKey

    '); body.appendHtml('
    ${timeseries.computeStats()}
    '); - // TODO(kevmoo): remove `NodeGlue` cast when we no longer need to support - // pkg:web 0.3.0 - NodeGlue(body).append(TimeseriesVisualization(timeseries).render()); + body.append(TimeseriesVisualization(timeseries).render()); }); } @@ -168,10 +147,10 @@ class TimeseriesVisualization { /// Creates a visualization for a [Timeseries]. TimeseriesVisualization(this._timeseries) { _stats = _timeseries.computeStats(); - _canvas = CanvasElement(); - _screenWidth = window.screen.width; + _canvas = html.CanvasElement(); + _screenWidth = html.window.screen!.width!; _canvas.width = _screenWidth; - _canvas.height = (_kCanvasHeight * window.devicePixelRatio).round(); + _canvas.height = (_kCanvasHeight * html.window.devicePixelRatio).round(); _canvas.style ..width = '100%' ..height = '${_kCanvasHeight}px' @@ -192,8 +171,8 @@ class TimeseriesVisualization { final Timeseries _timeseries; late TimeseriesStats _stats; - late CanvasElement _canvas; - late CanvasRenderingContext2D _ctx; + late html.CanvasElement _canvas; + late html.CanvasRenderingContext2D _ctx; late int _screenWidth; // Used to normalize benchmark values to chart height. @@ -215,9 +194,9 @@ class TimeseriesVisualization { } /// Renders the timeseries into a `` and returns the canvas element. - CanvasElement render() { - _ctx.translate(0, _kCanvasHeight * window.devicePixelRatio); - _ctx.scale(1, -window.devicePixelRatio); + html.CanvasElement render() { + _ctx.translate(0, _kCanvasHeight * html.window.devicePixelRatio); + _ctx.scale(1, -html.window.devicePixelRatio); final double barWidth = _screenWidth / _stats.samples.length; double xOffset = 0; @@ -226,19 +205,19 @@ class TimeseriesVisualization { if (sample.isWarmUpValue) { // Put gray background behind warm-up samples. - _ctx.fillStyle = 'rgba(200,200,200,1)'.toJS; + _ctx.fillStyle = 'rgba(200,200,200,1)'; _ctx.fillRect(xOffset, 0, barWidth, _normalized(_maxValueChartRange)); } if (sample.magnitude > _maxValueChartRange) { // The sample value is so big it doesn't fit on the chart. Paint it purple. - _ctx.fillStyle = 'rgba(100,50,100,0.8)'.toJS; + _ctx.fillStyle = 'rgba(100,50,100,0.8)'; } else if (sample.isOutlier) { // The sample is an outlier, color it light red. - _ctx.fillStyle = 'rgba(255,50,50,0.6)'.toJS; + _ctx.fillStyle = 'rgba(255,50,50,0.6)'; } else { // A non-outlier sample, color it light blue. - _ctx.fillStyle = 'rgba(50,50,255,0.6)'.toJS; + _ctx.fillStyle = 'rgba(50,50,255,0.6)'; } _ctx.fillRect(xOffset, 0, barWidth - 1, _normalized(sample.magnitude)); @@ -251,12 +230,12 @@ class TimeseriesVisualization { _normalized(_stats.average)); // Draw a horizontal dashed line corresponding to the outlier cut off. - _ctx.setLineDash([5.toJS, 5.toJS].toJS); + _ctx.setLineDash([5, 5]); drawLine(0, _normalized(_stats.outlierCutOff), _screenWidth, _normalized(_stats.outlierCutOff)); // Draw a light red band that shows the noise (1 stddev in each direction). - _ctx.fillStyle = 'rgba(255,50,50,0.3)'.toJS; + _ctx.fillStyle = 'rgba(255,50,50,0.3)'; _ctx.fillRect( 0, _normalized(_stats.average * (1 - _stats.noise)), @@ -289,7 +268,7 @@ class LocalBenchmarkServerClient { /// Returns [kManualFallback] if local server is not available (uses 404 as a /// signal). Future requestNextBenchmark() async { - final XMLHttpRequest request = await _requestXhr( + final html.HttpRequest request = await _requestXhr( '/next-benchmark', method: 'POST', mimeType: 'application/json', @@ -304,7 +283,7 @@ class LocalBenchmarkServerClient { } isInManualMode = false; - return request.responseText; + return request.responseText ?? kManualFallback; } void _checkNotManualMode() { @@ -320,7 +299,7 @@ class LocalBenchmarkServerClient { /// DevTools Protocol. Future startPerformanceTracing(String? benchmarkName) async { _checkNotManualMode(); - await HttpRequest.request( + await html.HttpRequest.request( '/start-performance-tracing?label=$benchmarkName', method: 'POST', mimeType: 'application/json', @@ -330,7 +309,7 @@ class LocalBenchmarkServerClient { /// Stops the performance tracing session started by [startPerformanceTracing]. Future stopPerformanceTracing() async { _checkNotManualMode(); - await HttpRequest.request( + await html.HttpRequest.request( '/stop-performance-tracing', method: 'POST', mimeType: 'application/json', @@ -341,7 +320,7 @@ class LocalBenchmarkServerClient { /// server. Future sendProfileData(Profile profile) async { _checkNotManualMode(); - final XMLHttpRequest request = await _requestXhr( + final html.HttpRequest request = await html.HttpRequest.request( '/profile-data', method: 'POST', mimeType: 'application/json', @@ -358,7 +337,7 @@ class LocalBenchmarkServerClient { /// The server will halt the devicelab task and log the error. Future reportError(dynamic error, StackTrace stackTrace) async { _checkNotManualMode(); - await HttpRequest.request( + await html.HttpRequest.request( '/on-error', method: 'POST', mimeType: 'application/json', @@ -372,7 +351,7 @@ class LocalBenchmarkServerClient { /// Reports a message about the demo to the benchmark server. Future printToConsole(String report) async { _checkNotManualMode(); - await HttpRequest.request( + await html.HttpRequest.request( '/print-to-console', method: 'POST', mimeType: 'text/plain', @@ -380,27 +359,23 @@ class LocalBenchmarkServerClient { ); } - /// This is the same as calling [XMLHttpRequest.request] but it doesn't + /// This is the same as calling [html.HttpRequest.request] but it doesn't /// crash on 404, which we use to detect `flutter run`. - Future _requestXhr( + Future _requestXhr( String url, { required String method, required String mimeType, - required String sendData, + required dynamic sendData, }) { - final Completer completer = Completer(); - final XMLHttpRequest xhr = XMLHttpRequest(); - xhr.open(method, url, true); + final Completer completer = Completer(); + final html.HttpRequest xhr = html.HttpRequest(); + xhr.open(method, url, async: true); xhr.overrideMimeType(mimeType); - xhr.onLoad.listen((ProgressEvent e) { + xhr.onLoad.listen((html.ProgressEvent e) { completer.complete(xhr); }); xhr.onError.listen(completer.completeError); - xhr.send(sendData.toJS); + xhr.send(sendData); return completer.future; } } - -extension on HTMLElement { - void appendHtml(String input) => insertAdjacentHTML('beforeend', input); -} diff --git a/packages/web_benchmarks/lib/server.dart b/packages/web_benchmarks/lib/server.dart index 1742ac507c92..7d16b79940ec 100644 --- a/packages/web_benchmarks/lib/server.dart +++ b/packages/web_benchmarks/lib/server.dart @@ -8,12 +8,9 @@ import 'dart:io' as io; import 'package:logging/logging.dart'; import 'src/benchmark_result.dart'; -import 'src/common.dart'; -import 'src/compilation_options.dart'; import 'src/runner.dart'; export 'src/benchmark_result.dart'; -export 'src/compilation_options.dart'; /// The default port number used by the local benchmark server. const int defaultBenchmarkServerPort = 9999; @@ -45,12 +42,11 @@ const int defaultChromeDebugPort = 10000; Future serveWebBenchmark({ required io.Directory benchmarkAppDirectory, required String entryPoint, + required bool useCanvasKit, int benchmarkServerPort = defaultBenchmarkServerPort, int chromeDebugPort = defaultChromeDebugPort, bool headless = true, bool treeShakeIcons = true, - String initialPage = defaultInitialPage, - CompilationOptions compilationOptions = const CompilationOptions(), }) async { // Reduce logging level. Otherwise, package:webkit_inspection_protocol is way too spammy. Logger.root.level = Level.INFO; @@ -58,11 +54,10 @@ Future serveWebBenchmark({ return BenchmarkServer( benchmarkAppDirectory: benchmarkAppDirectory, entryPoint: entryPoint, + useCanvasKit: useCanvasKit, benchmarkServerPort: benchmarkServerPort, chromeDebugPort: chromeDebugPort, headless: headless, - compilationOptions: compilationOptions, treeShakeIcons: treeShakeIcons, - initialPage: initialPage, ).run(); } diff --git a/packages/web_benchmarks/lib/src/benchmark_result.dart b/packages/web_benchmarks/lib/src/benchmark_result.dart index ac80c747345a..125bc2cd4ec9 100644 --- a/packages/web_benchmarks/lib/src/benchmark_result.dart +++ b/packages/web_benchmarks/lib/src/benchmark_result.dart @@ -10,27 +10,8 @@ class BenchmarkScore { BenchmarkScore({ required this.metric, required this.value, - this.delta, }); - /// Deserializes a JSON object to create a [BenchmarkScore] object. - factory BenchmarkScore.parse(Map json) { - final String metric = json[metricKey]! as String; - final double value = (json[valueKey]! as num).toDouble(); - final num? delta = json[deltaKey] as num?; - return BenchmarkScore(metric: metric, value: value, delta: delta); - } - - /// The key for the value [metric] in the [BenchmarkScore] JSON - /// representation. - static const String metricKey = 'metric'; - - /// The key for the value [value] in the [BenchmarkScore] JSON representation. - static const String valueKey = 'value'; - - /// The key for the value [delta] in the [BenchmarkScore] JSON representation. - static const String deltaKey = 'delta'; - /// The name of the metric that this score is categorized under. /// /// Scores collected over time under the same name can be visualized as a @@ -40,18 +21,11 @@ class BenchmarkScore { /// The result of measuring a particular metric in this benchmark run. final num value; - /// Optional delta value describing the difference between this metric's score - /// and the score of a matching metric from another [BenchmarkResults]. - /// - /// This value may be assigned by the [computeDelta] analysis method. - final num? delta; - /// Serializes the benchmark metric to a JSON object. - Map toJson() { - return { - metricKey: metric, - valueKey: value, - if (delta != null) deltaKey: delta, + Map toJson() { + return { + 'metric': metric, + 'value': value, }; } } @@ -61,30 +35,22 @@ class BenchmarkResults { /// Constructs a result containing scores from a single run benchmark run. BenchmarkResults(this.scores); - /// Deserializes a JSON object to create a [BenchmarkResults] object. - factory BenchmarkResults.parse(Map json) { - final Map> results = - >{}; - for (final String key in json.keys) { - final List scores = (json[key]! as List) - .cast>() - .map(BenchmarkScore.parse) - .toList(growable: false); - results[key] = scores; - } - return BenchmarkResults(results); - } - /// Scores collected in a benchmark run. final Map> scores; /// Serializes benchmark metrics to JSON. - Map>> toJson() { - return scores.map>>( + Map>> toJson() { + return scores.map>>( (String benchmarkName, List scores) { - return MapEntry>>( + return MapEntry>>( benchmarkName, - scores.map((BenchmarkScore score) => score.toJson()).toList(), + scores + .map>( + (BenchmarkScore score) => { + 'metric': score.metric, + 'value': score.value, + }) + .toList(), ); }); } diff --git a/packages/web_benchmarks/lib/src/common.dart b/packages/web_benchmarks/lib/src/common.dart index 5c7c7259796a..536cbea236dd 100644 --- a/packages/web_benchmarks/lib/src/common.dart +++ b/packages/web_benchmarks/lib/src/common.dart @@ -14,7 +14,3 @@ const int kMeasuredSampleCount = 100; /// A special value returned by the `/next-benchmark` HTTP POST request when /// all benchmarks have run and there are no more benchmarks to run. const String kEndOfBenchmarks = '__end_of_benchmarks__'; - -/// The default initial page to load upon opening the benchmark app or reloading -/// it in Chrome. -const String defaultInitialPage = 'index.html'; diff --git a/packages/web_benchmarks/lib/src/compilation_options.dart b/packages/web_benchmarks/lib/src/compilation_options.dart deleted file mode 100644 index 3a994703c63e..000000000000 --- a/packages/web_benchmarks/lib/src/compilation_options.dart +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/// Compilation options for bulding a Flutter web app. -/// -/// This object holds metadata that is used to determine how the benchmark app -/// should be built. -class CompilationOptions { - /// Creates a [CompilationOptions] object. - const CompilationOptions({ - this.renderer = WebRenderer.canvaskit, - this.useWasm = false, - }); - - /// The renderer to use for the build. - final WebRenderer renderer; - - /// Whether to build the app with dart2wasm. - final bool useWasm; - - @override - String toString() { - return '(renderer: ${renderer.name}, compiler: ${useWasm ? 'dart2wasm' : 'dart2js'})'; - } -} - -/// The possible types of web renderers Flutter can build for. -enum WebRenderer { - /// The HTML web renderer. - html, - - /// The CanvasKit web renderer. - canvaskit, - - /// The SKIA Wasm web renderer. - skwasm, -} diff --git a/packages/web_benchmarks/lib/src/recorder.dart b/packages/web_benchmarks/lib/src/recorder.dart index c4b5ca8e3b55..51fa697cecfd 100644 --- a/packages/web_benchmarks/lib/src/recorder.dart +++ b/packages/web_benchmarks/lib/src/recorder.dart @@ -3,10 +3,11 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:js_interop'; +import 'dart:html' as html; +import 'dart:js'; +import 'dart:js_util' as js_util; import 'dart:math' as math; import 'dart:ui'; -import 'dart:ui_web' as ui_web; import 'package:flutter/foundation.dart'; import 'package:flutter/gestures.dart'; @@ -15,7 +16,6 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:flutter/widgets.dart'; import 'package:meta/meta.dart'; -import 'package:web/helpers.dart' as html; import 'common.dart'; @@ -1189,7 +1189,7 @@ void endMeasureFrame() { html.window.performance.mark('measured_frame_end#$_currentFrameNumber'); html.window.performance.measure( 'measured_frame', - 'measured_frame_start#$_currentFrameNumber'.toJS, + 'measured_frame_start#$_currentFrameNumber', 'measured_frame_end#$_currentFrameNumber', ); @@ -1211,21 +1211,19 @@ final Map _engineBenchmarkListeners = /// /// If another listener is already registered, overrides it. void registerEngineBenchmarkValueListener( - String name, - EngineBenchmarkValueListener listener, -) { + String name, EngineBenchmarkValueListener listener) { if (_engineBenchmarkListeners.containsKey(name)) { - throw StateError( - 'A listener for "$name" is already registered.\n' - 'Call `stopListeningToEngineBenchmarkValues` to unregister the previous ' - 'listener before registering a new one.', - ); + throw StateError('A listener for "$name" is already registered.\n' + 'Call `stopListeningToEngineBenchmarkValues` to unregister the previous ' + 'listener before registering a new one.'); } if (_engineBenchmarkListeners.isEmpty) { // The first listener is being registered. Register the global listener. - ui_web.benchmarkValueCallback = _dispatchEngineBenchmarkValue; + js_util.setProperty(html.window, '_flutter_internal_on_benchmark', + allowInterop(_dispatchEngineBenchmarkValue)); } + _engineBenchmarkListeners[name] = listener; } @@ -1234,7 +1232,7 @@ void stopListeningToEngineBenchmarkValues(String name) { _engineBenchmarkListeners.remove(name); if (_engineBenchmarkListeners.isEmpty) { // The last listener unregistered. Remove the global listener. - ui_web.benchmarkValueCallback = null; + js_util.setProperty(html.window, '_flutter_internal_on_benchmark', null); } } diff --git a/packages/web_benchmarks/lib/src/runner.dart b/packages/web_benchmarks/lib/src/runner.dart index 8eeaeb0617ac..66293538d8c2 100644 --- a/packages/web_benchmarks/lib/src/runner.dart +++ b/packages/web_benchmarks/lib/src/runner.dart @@ -18,7 +18,6 @@ import 'package:shelf_static/shelf_static.dart'; import 'benchmark_result.dart'; import 'browser.dart'; import 'common.dart'; -import 'compilation_options.dart'; /// The default port number used by the local benchmark server. const int defaultBenchmarkServerPort = 9999; @@ -51,12 +50,11 @@ class BenchmarkServer { BenchmarkServer({ required this.benchmarkAppDirectory, required this.entryPoint, + required this.useCanvasKit, required this.benchmarkServerPort, required this.chromeDebugPort, required this.headless, required this.treeShakeIcons, - this.compilationOptions = const CompilationOptions(), - this.initialPage = defaultInitialPage, }); final ProcessManager _processManager = const LocalProcessManager(); @@ -73,8 +71,8 @@ class BenchmarkServer { /// the app. final String entryPoint; - /// The compilation options to use for building the benchmark web app. - final CompilationOptions compilationOptions; + /// Whether to build the app in CanvasKit mode. + final bool useCanvasKit; /// The port this benchmark server serves the app on. final int benchmarkServerPort; @@ -92,14 +90,6 @@ class BenchmarkServer { /// When false, '--no-tree-shake-icons' will be passed as a build argument. final bool treeShakeIcons; - /// The initial page to load upon opening the benchmark app in Chrome. - /// - /// The default value is [defaultInitialPage]. - final String initialPage; - - String get _benchmarkAppUrl => - 'http://localhost:$benchmarkServerPort/$initialPage'; - /// Builds and serves the benchmark app, and collects benchmark results. Future run() async { // Reduce logging level. Otherwise, package:webkit_inspection_protocol is way too spammy. @@ -110,20 +100,13 @@ class BenchmarkServer { "flutter executable is not runnable. Make sure it's in the PATH."); } - final DateTime startTime = DateTime.now(); - print('Building Flutter web app $compilationOptions...'); final io.ProcessResult buildResult = await _processManager.run( [ 'flutter', 'build', 'web', - if (compilationOptions.useWasm) ...[ - '--wasm', - '--wasm-opt=debug', - '--omit-type-checks', - ], - '--web-renderer=${compilationOptions.renderer.name}', '--dart-define=FLUTTER_WEB_ENABLE_PROFILING=true', + if (useCanvasKit) '--dart-define=FLUTTER_WEB_USE_SKIA=true', if (!treeShakeIcons) '--no-tree-shake-icons', '--profile', '-t', @@ -132,12 +115,6 @@ class BenchmarkServer { workingDirectory: benchmarkAppDirectory.path, ); - final int buildTime = Duration( - milliseconds: DateTime.now().millisecondsSinceEpoch - - startTime.millisecondsSinceEpoch, - ).inSeconds; - print('Build took ${buildTime}s to complete.'); - if (buildResult.exitCode != 0) { io.stderr.writeln(buildResult.stdout); io.stderr.writeln(buildResult.stderr); @@ -275,7 +252,7 @@ class BenchmarkServer { .path; final ChromeOptions options = ChromeOptions( - url: _benchmarkAppUrl, + url: 'http://localhost:$benchmarkServerPort/index.html', userDataDirectory: userDataDir, headless: headless, debugPort: chromeDebugPort, diff --git a/packages/web_benchmarks/pubspec.yaml b/packages/web_benchmarks/pubspec.yaml index 117d8dd246e8..5390cfcac474 100644 --- a/packages/web_benchmarks/pubspec.yaml +++ b/packages/web_benchmarks/pubspec.yaml @@ -2,14 +2,13 @@ name: web_benchmarks description: A benchmark harness for performance-testing Flutter apps in Chrome. repository: https://github.com/flutter/packages/tree/main/packages/web_benchmarks issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+web_benchmarks%22 -version: 1.1.0 +version: 0.1.0+8 environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.16.0" + sdk: ">=3.0.0 <4.0.0" + flutter: ">=3.10.0" dependencies: - collection: ^1.18.0 flutter: sdk: flutter flutter_test: @@ -21,7 +20,6 @@ dependencies: shelf: ^1.2.0 shelf_static: ^1.1.0 test: ^1.19.5 - web: '>=0.3.0 <0.5.0' webkit_inspection_protocol: ^1.0.0 topics: diff --git a/packages/web_benchmarks/test/src/analysis_test.dart b/packages/web_benchmarks/test/src/analysis_test.dart deleted file mode 100644 index 852cb4c64083..000000000000 --- a/packages/web_benchmarks/test/src/analysis_test.dart +++ /dev/null @@ -1,330 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter_test/flutter_test.dart'; -import 'package:web_benchmarks/analysis.dart'; - -void main() { - group('averageBenchmarkResults', () { - test('succeeds for identical benchmark names and metrics', () { - final BenchmarkResults result1 = BenchmarkResults( - >{ - 'foo': [ - BenchmarkScore(metric: 'foo.bar', value: 6), - BenchmarkScore(metric: 'foo.baz', value: 10), - ], - 'bar': [ - BenchmarkScore(metric: 'bar.foo', value: 2.4), - ], - }, - ); - final BenchmarkResults result2 = BenchmarkResults( - >{ - 'foo': [ - BenchmarkScore(metric: 'foo.bar', value: 4), - BenchmarkScore(metric: 'foo.baz', value: 10), - ], - 'bar': [ - BenchmarkScore(metric: 'bar.foo', value: 1.2), - ], - }, - ); - final BenchmarkResults average = - computeAverage([result1, result2]); - expect( - average.toJson(), - >>{ - 'foo': >[ - {'metric': 'foo.bar', 'value': 5}, - {'metric': 'foo.baz', 'value': 10}, - ], - 'bar': >[ - {'metric': 'bar.foo', 'value': 1.7999999999999998}, - ], - }, - ); - }); - - test('fails for mismatched benchmark names', () { - final BenchmarkResults result1 = BenchmarkResults( - >{ - 'foo': [BenchmarkScore(metric: 'foo.bar', value: 6)], - }, - ); - final BenchmarkResults result2 = BenchmarkResults( - >{ - 'foo1': [BenchmarkScore(metric: 'foo.bar', value: 4)], - }, - ); - expect( - () { - computeAverage([result1, result2]); - }, - throwsException, - ); - }); - - test('fails for mismatched benchmark metrics', () { - final BenchmarkResults result1 = BenchmarkResults( - >{ - 'foo': [BenchmarkScore(metric: 'foo.bar', value: 6)], - }, - ); - final BenchmarkResults result2 = BenchmarkResults( - >{ - 'foo': [BenchmarkScore(metric: 'foo.boo', value: 4)], - }, - ); - expect( - () { - computeAverage([result1, result2]); - }, - throwsException, - ); - }); - }); - - test('computeDelta', () { - final BenchmarkResults benchmark1 = - BenchmarkResults.parse(testBenchmarkResults1); - final BenchmarkResults benchmark2 = - BenchmarkResults.parse(testBenchmarkResults2); - final BenchmarkResults delta = computeDelta(benchmark1, benchmark2); - expect(delta.toJson(), expectedBenchmarkDelta); - }); -} - -final Map>> testBenchmarkResults1 = - >>{ - 'foo': >[ - {'metric': 'preroll_frame.average', 'value': 60.5}, - {'metric': 'preroll_frame.outlierAverage', 'value': 1400}, - {'metric': 'preroll_frame.outlierRatio', 'value': 20.2}, - {'metric': 'preroll_frame.noise', 'value': 0.85}, - {'metric': 'apply_frame.average', 'value': 80.0}, - {'metric': 'apply_frame.outlierAverage', 'value': 200.6}, - {'metric': 'apply_frame.outlierRatio', 'value': 2.5}, - {'metric': 'apply_frame.noise', 'value': 0.4}, - {'metric': 'drawFrameDuration.average', 'value': 2058.9}, - { - 'metric': 'drawFrameDuration.outlierAverage', - 'value': 24000, - }, - { - 'metric': 'drawFrameDuration.outlierRatio', - 'value': 12.05, - }, - {'metric': 'drawFrameDuration.noise', 'value': 0.34}, - {'metric': 'totalUiFrame.average', 'value': 4166}, - ], - 'bar': >[ - {'metric': 'preroll_frame.average', 'value': 60.5}, - {'metric': 'preroll_frame.outlierAverage', 'value': 1400}, - {'metric': 'preroll_frame.outlierRatio', 'value': 20.2}, - {'metric': 'preroll_frame.noise', 'value': 0.85}, - {'metric': 'apply_frame.average', 'value': 80.0}, - {'metric': 'apply_frame.outlierAverage', 'value': 200.6}, - {'metric': 'apply_frame.outlierRatio', 'value': 2.5}, - {'metric': 'apply_frame.noise', 'value': 0.4}, - {'metric': 'drawFrameDuration.average', 'value': 2058.9}, - { - 'metric': 'drawFrameDuration.outlierAverage', - 'value': 24000, - }, - { - 'metric': 'drawFrameDuration.outlierRatio', - 'value': 12.05, - }, - {'metric': 'drawFrameDuration.noise', 'value': 0.34}, - {'metric': 'totalUiFrame.average', 'value': 4166}, - ], -}; - -final Map>> testBenchmarkResults2 = - >>{ - 'foo': >[ - {'metric': 'preroll_frame.average', 'value': 65.5}, - {'metric': 'preroll_frame.outlierAverage', 'value': 1410}, - {'metric': 'preroll_frame.outlierRatio', 'value': 20.0}, - {'metric': 'preroll_frame.noise', 'value': 1.5}, - {'metric': 'apply_frame.average', 'value': 50.0}, - {'metric': 'apply_frame.outlierAverage', 'value': 100.0}, - {'metric': 'apply_frame.outlierRatio', 'value': 2.55}, - {'metric': 'apply_frame.noise', 'value': 0.9}, - {'metric': 'drawFrameDuration.average', 'value': 2000.0}, - { - 'metric': 'drawFrameDuration.outlierAverage', - 'value': 20000 - }, - { - 'metric': 'drawFrameDuration.outlierRatio', - 'value': 11.05 - }, - {'metric': 'drawFrameDuration.noise', 'value': 1.34}, - {'metric': 'totalUiFrame.average', 'value': 4150}, - ], - 'bar': >[ - {'metric': 'preroll_frame.average', 'value': 65.5}, - {'metric': 'preroll_frame.outlierAverage', 'value': 1410}, - {'metric': 'preroll_frame.outlierRatio', 'value': 20.0}, - {'metric': 'preroll_frame.noise', 'value': 1.5}, - {'metric': 'apply_frame.average', 'value': 50.0}, - {'metric': 'apply_frame.outlierAverage', 'value': 100.0}, - {'metric': 'apply_frame.outlierRatio', 'value': 2.55}, - {'metric': 'apply_frame.noise', 'value': 0.9}, - {'metric': 'drawFrameDuration.average', 'value': 2000.0}, - { - 'metric': 'drawFrameDuration.outlierAverage', - 'value': 20000 - }, - { - 'metric': 'drawFrameDuration.outlierRatio', - 'value': 11.05 - }, - {'metric': 'drawFrameDuration.noise', 'value': 1.34}, - {'metric': 'totalUiFrame.average', 'value': 4150}, - ], -}; - -final Map>> expectedBenchmarkDelta = - >>{ - 'foo': >[ - { - 'metric': 'preroll_frame.average', - 'value': 65.5, - 'delta': 5.0 - }, - { - 'metric': 'preroll_frame.outlierAverage', - 'value': 1410.0, - 'delta': 10.0, - }, - { - 'metric': 'preroll_frame.outlierRatio', - 'value': 20.0, - 'delta': -0.1999999999999993, - }, - { - 'metric': 'preroll_frame.noise', - 'value': 1.5, - 'delta': 0.65, - }, - { - 'metric': 'apply_frame.average', - 'value': 50.0, - 'delta': -30.0, - }, - { - 'metric': 'apply_frame.outlierAverage', - 'value': 100.0, - 'delta': -100.6, - }, - { - 'metric': 'apply_frame.outlierRatio', - 'value': 2.55, - 'delta': 0.04999999999999982, - }, - { - 'metric': 'apply_frame.noise', - 'value': 0.9, - 'delta': 0.5, - }, - { - 'metric': 'drawFrameDuration.average', - 'value': 2000.0, - 'delta': -58.90000000000009, - }, - { - 'metric': 'drawFrameDuration.outlierAverage', - 'value': 20000.0, - 'delta': -4000.0, - }, - { - 'metric': 'drawFrameDuration.outlierRatio', - 'value': 11.05, - 'delta': -1.0, - }, - { - 'metric': 'drawFrameDuration.noise', - 'value': 1.34, - 'delta': 1.0, - }, - { - 'metric': 'totalUiFrame.average', - 'value': 4150.0, - 'delta': -16.0, - }, - ], - 'bar': >[ - { - 'metric': 'preroll_frame.average', - 'value': 65.5, - 'delta': 5.0, - }, - { - 'metric': 'preroll_frame.outlierAverage', - 'value': 1410.0, - 'delta': 10.0, - }, - { - 'metric': 'preroll_frame.outlierRatio', - 'value': 20.0, - 'delta': -0.1999999999999993, - }, - { - 'metric': 'preroll_frame.noise', - 'value': 1.5, - 'delta': 0.65, - }, - { - 'metric': 'apply_frame.average', - 'value': 50.0, - 'delta': -30.0, - }, - { - 'metric': 'apply_frame.outlierAverage', - 'value': 100.0, - 'delta': -100.6, - }, - { - 'metric': 'apply_frame.outlierRatio', - 'value': 2.55, - 'delta': 0.04999999999999982, - }, - { - 'metric': 'apply_frame.noise', - 'value': 0.9, - 'delta': 0.5, - }, - { - 'metric': 'drawFrameDuration.average', - 'value': 2000.0, - 'delta': -58.90000000000009, - }, - { - 'metric': 'drawFrameDuration.outlierAverage', - 'value': 20000.0, - 'delta': -4000.0, - }, - { - 'metric': 'drawFrameDuration.outlierRatio', - 'value': 11.05, - 'delta': -1.0, - }, - { - 'metric': 'drawFrameDuration.noise', - 'value': 1.34, - 'delta': 1.0, - }, - { - 'metric': 'totalUiFrame.average', - 'value': 4150.0, - 'delta': -16.0, - }, - ], -}; diff --git a/packages/web_benchmarks/test/src/benchmark_result_test.dart b/packages/web_benchmarks/test/src/benchmark_result_test.dart deleted file mode 100644 index 65adee8556ab..000000000000 --- a/packages/web_benchmarks/test/src/benchmark_result_test.dart +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter_test/flutter_test.dart'; -import 'package:web_benchmarks/server.dart'; - -void main() { - group('can serialize and deserialize', () { - test('$BenchmarkResults', () { - final Map data = { - 'foo': >[ - {'metric': 'foo.bar', 'value': 12.34, 'delta': -0.2}, - {'metric': 'foo.baz', 'value': 10, 'delta': 3.3}, - ], - 'bar': >[ - {'metric': 'bar.foo', 'value': 1.23}, - ] - }; - - final BenchmarkResults benchmarkResults = BenchmarkResults.parse(data); - expect(benchmarkResults.scores.length, 2); - final List fooBenchmarks = - benchmarkResults.scores['foo']!; - final List barBenchmarks = - benchmarkResults.scores['bar']!; - expect(fooBenchmarks.length, 2); - expect(fooBenchmarks[0].metric, 'foo.bar'); - expect(fooBenchmarks[0].value, 12.34); - expect(fooBenchmarks[0].delta, -0.2); - expect(fooBenchmarks[1].metric, 'foo.baz'); - expect(fooBenchmarks[1].value, 10); - expect(fooBenchmarks[1].delta, 3.3); - expect(barBenchmarks.length, 1); - expect(barBenchmarks[0].metric, 'bar.foo'); - expect(barBenchmarks[0].value, 1.23); - expect(barBenchmarks[0].delta, isNull); - - expect(benchmarkResults.toJson(), data); - }); - - test('$BenchmarkScore', () { - final Map data = { - 'metric': 'foo', - 'value': 1.234, - 'delta': -0.4, - }; - - final BenchmarkScore score = BenchmarkScore.parse(data); - expect(score.metric, 'foo'); - expect(score.value, 1.234); - expect(score.delta, -0.4); - - expect(score.toJson(), data); - }); - }); -} diff --git a/packages/web_benchmarks/testing/README.md b/packages/web_benchmarks/testing/README.md index fda2b308980d..58e8429952c5 100644 --- a/packages/web_benchmarks/testing/README.md +++ b/packages/web_benchmarks/testing/README.md @@ -11,7 +11,7 @@ do the following: * Fetch dependencies for the `test_app` directory inside `testing`: ```bash - flutter pub get --directory testing/test_app + flutter pub get testing/test_app ``` * Fetch dependencies for the `web_benchmarks` directory: diff --git a/packages/web_benchmarks/testing/test_app/.gitignore b/packages/web_benchmarks/testing/test_app/.gitignore index 9f6b8e534c28..9d532b18a01f 100644 --- a/packages/web_benchmarks/testing/test_app/.gitignore +++ b/packages/web_benchmarks/testing/test_app/.gitignore @@ -31,6 +31,9 @@ .pub/ /build/ +# Web related +lib/generated_plugin_registrant.dart + # Symbolication related app.*.symbols diff --git a/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner_simple.dart b/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner_simple.dart deleted file mode 100644 index 7b6c6ae694db..000000000000 --- a/packages/web_benchmarks/testing/test_app/lib/benchmarks/runner_simple.dart +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter_test/flutter_test.dart'; -import 'package:web_benchmarks/client.dart'; - -import 'runner.dart'; - -class SimpleRecorder extends AppRecorder { - SimpleRecorder() : super(benchmarkName: 'simple'); - - @override - Future automate() async { - // Do nothing. - } -} - -Future main() async { - await runBenchmarks({ - 'simple': () => SimpleRecorder(), - }); -} diff --git a/packages/web_benchmarks/testing/web_benchmarks_test.dart b/packages/web_benchmarks/testing/web_benchmarks_test.dart index 4a3ffa351690..7d092c9eb1e1 100644 --- a/packages/web_benchmarks/testing/web_benchmarks_test.dart +++ b/packages/web_benchmarks/testing/web_benchmarks_test.dart @@ -8,75 +8,45 @@ import 'dart:io'; import 'package:test/test.dart'; import 'package:web_benchmarks/server.dart'; -import 'package:web_benchmarks/src/common.dart'; Future main() async { test('Can run a web benchmark', () async { - await _runBenchmarks( - benchmarkNames: ['scroll', 'page', 'tap'], + final BenchmarkResults taskResult = await serveWebBenchmark( + benchmarkAppDirectory: Directory('testing/test_app'), entryPoint: 'lib/benchmarks/runner.dart', + useCanvasKit: false, + treeShakeIcons: false, ); - }, timeout: Timeout.none); - - test('Can run a web benchmark with an alternate initial page', () async { - await _runBenchmarks( - benchmarkNames: ['simple'], - entryPoint: 'lib/benchmarks/runner_simple.dart', - initialPage: 'index.html#about', - ); - }, timeout: Timeout.none); - - test('Can run a web benchmark with wasm', () async { - await _runBenchmarks( - benchmarkNames: ['simple'], - entryPoint: 'lib/benchmarks/runner_simple.dart', - compilationOptions: const CompilationOptions(useWasm: true), - ); - }, timeout: Timeout.none); -} - -Future _runBenchmarks({ - required List benchmarkNames, - required String entryPoint, - String initialPage = defaultInitialPage, - CompilationOptions compilationOptions = const CompilationOptions(), -}) async { - final BenchmarkResults taskResult = await serveWebBenchmark( - benchmarkAppDirectory: Directory('testing/test_app'), - entryPoint: entryPoint, - treeShakeIcons: false, - initialPage: initialPage, - compilationOptions: compilationOptions, - ); - for (final String benchmarkName in benchmarkNames) { - for (final String metricName in [ - 'preroll_frame', - 'apply_frame', - 'drawFrameDuration', - ]) { - for (final String valueName in [ - 'average', - 'outlierAverage', - 'outlierRatio', - 'noise', + for (final String benchmarkName in ['scroll', 'page', 'tap']) { + for (final String metricName in [ + 'preroll_frame', + 'apply_frame', + 'drawFrameDuration', ]) { - expect( - taskResult.scores[benchmarkName]!.where((BenchmarkScore score) => - score.metric == '$metricName.$valueName'), - hasLength(1), - ); + for (final String valueName in [ + 'average', + 'outlierAverage', + 'outlierRatio', + 'noise', + ]) { + expect( + taskResult.scores[benchmarkName]!.where((BenchmarkScore score) => + score.metric == '$metricName.$valueName'), + hasLength(1), + ); + } } + expect( + taskResult.scores[benchmarkName]!.where( + (BenchmarkScore score) => score.metric == 'totalUiFrame.average'), + hasLength(1), + ); } + expect( - taskResult.scores[benchmarkName]!.where( - (BenchmarkScore score) => score.metric == 'totalUiFrame.average'), - hasLength(1), + const JsonEncoder.withIndent(' ').convert(taskResult.toJson()), + isA(), ); - } - - expect( - const JsonEncoder.withIndent(' ').convert(taskResult.toJson()), - isA(), - ); + }, timeout: Timeout.none); } diff --git a/packages/webview_flutter/webview_flutter/CHANGELOG.md b/packages/webview_flutter/webview_flutter/CHANGELOG.md index 3e2c39d30128..e1634a5d3af3 100644 --- a/packages/webview_flutter/webview_flutter/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter/CHANGELOG.md @@ -1,5 +1,6 @@ -## NEXT +## 4.5.0 +* Adds support for HTTP basic authentication. See `NavigationDelegate(onReceivedHttpAuthRequest)`. * Updates minimum supported SDK version to Flutter 3.10/Dart 3.0. ## 4.4.2 diff --git a/packages/webview_flutter/webview_flutter/example/flutter_01.log b/packages/webview_flutter/webview_flutter/example/flutter_01.log new file mode 100644 index 000000000000..91d4f7599de7 --- /dev/null +++ b/packages/webview_flutter/webview_flutter/example/flutter_01.log @@ -0,0 +1,94 @@ +Flutter crash report. +Please report a bug at https://github.com/flutter/flutter/issues. + +## command + +flutter --quiet assemble --no-version-check --depfile /Users/jeroen/Projects/andrei-webview-authentication/packages/webview_flutter/webview_flutter/example/build/app/intermediates/flutter/debug/flutter_build.d --output /Users/jeroen/Projects/andrei-webview-authentication/packages/webview_flutter/webview_flutter/example/build/app/intermediates/flutter/debug -dTargetFile=/Users/jeroen/Projects/andrei-webview-authentication/packages/webview_flutter/webview_flutter/example/lib/main.dart -dTargetPlatform=android -dBuildMode=debug -dTrackWidgetCreation=true --DartDefines=RkxVVFRFUl9XRUJfQVVUT19ERVRFQ1Q9dHJ1ZQ==,RkxVVFRFUl9XRUJfQ0FOVkFTS0lUX1VSTD1odHRwczovL3d3dy5nc3RhdGljLmNvbS9mbHV0dGVyLWNhbnZhc2tpdC83NGQxNjYyN2I5NDBiYjE1ZTUwODkxZjgyY2FkNmMzZTM0NjViZDZkLw== debug_android_application + +## exception + +FileSystemException: FileSystemException: Cannot resolve symbolic links, path = '/Users/jeroen/Projects/andrei-webview-authentication/packages/webview_flutter/webview_flutter/example/build/app/intermediates/flutter/debug' (OS Error: No such file or directory, errno = 2) + +``` +#0 FileSystemEntity._throwIfError (dart:io/file_system_entity.dart:829:7) +#1 FileSystemEntity.resolveSymbolicLinksSync (dart:io/file_system_entity.dart:348:5) +#2 ForwardingFileSystemEntity.resolveSymbolicLinksSync (package:file/src/forwarding/forwarding_file_system_entity.dart:56:49) +#3 ForwardingFileSystemEntity.resolveSymbolicLinksSync (package:file/src/forwarding/forwarding_file_system_entity.dart:56:49) +#4 SourceVisitor.visitPattern (package:flutter_tools/src/build_system/source.dart:116:67) +#5 _PatternSource.accept (package:flutter_tools/src/build_system/source.dart:255:49) +#6 Target._resolveConfiguration (package:flutter_tools/src/build_system/build_system.dart:249:14) +#7 Target.resolveOutputs (package:flutter_tools/src/build_system/build_system.dart:204:12) +#8 Target._toNode (package:flutter_tools/src/build_system/build_system.dart:150:39) +#9 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:609:30) +#10 AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:315:51) +#11 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1662:12) + +#12 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1350:27) + +#13 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) + +#14 CommandRunner.runCommand (package:args/command_runner.dart:212:13) + +#15 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:348:9) + +#16 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) + +#17 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:294:5) + +#18 run.. (package:flutter_tools/runner.dart:112:9) + +#19 AppContext.run. (package:flutter_tools/src/base/context.dart:150:19) + +#20 main (package:flutter_tools/executable.dart:90:3) + +``` + +## flutter doctor + +``` +[✓] Flutter (Channel stable, 3.16.0, on macOS 14.1 23B74 darwin-arm64, locale en-US) + • Flutter version 3.16.0 on channel stable at /Users/jeroen/Development/flutter + • Upstream repository https://github.com/flutter/flutter.git + • Framework revision db7ef5bf9f (5 weeks ago), 2023-11-15 11:25:44 -0800 + • Engine revision 74d16627b9 + • Dart version 3.2.0 + • DevTools version 2.28.2 + +[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) + • Android SDK at /Users/jeroen/Library/Android/sdk + • Platform android-34, build-tools 33.0.0 + • ANDROID_HOME = /Users/jeroen/Library/Android/sdk + • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java + • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) + • All Android licenses accepted. + +[✓] Xcode - develop for iOS and macOS (Xcode 15.1) + • Xcode at /Applications/Xcode.app/Contents/Developer + • Build 15C65 + • CocoaPods version 1.11.3 + +[✓] Chrome - develop for the web + • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome + +[✓] Android Studio (version 2022.2) + • Android Studio at /Applications/Android Studio.app/Contents + • Flutter plugin can be installed from: + 🔨 https://plugins.jetbrains.com/plugin/9212-flutter + • Dart plugin can be installed from: + 🔨 https://plugins.jetbrains.com/plugin/6351-dart + • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) + +[✓] VS Code (version 1.85.0) + • VS Code at /Applications/Visual Studio Code.app/Contents + • Flutter extension version 3.78.0 + +[✓] Connected device (3 available) + • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 14 (API 34) (emulator) + • macOS (desktop) • macos • darwin-arm64 • macOS 14.1 23B74 darwin-arm64 + • Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.109 + +[✓] Network resources + • All expected network resources are available. + +• No issues found! +``` diff --git a/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart b/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart index cee1b8b03442..615164b6cddc 100644 --- a/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart +++ b/packages/webview_flutter/webview_flutter/example/integration_test/webview_flutter_test.dart @@ -32,6 +32,25 @@ Future main() async { request.response.writeln('${request.headers}'); } else if (request.uri.path == '/favicon.ico') { request.response.statusCode = HttpStatus.notFound; + } else if (request.uri.path == '/http-basic-authentication') { + final List? authHeader = + request.headers[HttpHeaders.authorizationHeader]; + if (authHeader != null) { + final String encodedCredential = authHeader.first.split(' ')[1]; + final String credential = + String.fromCharCodes(base64Decode(encodedCredential)); + if (credential == 'user:password') { + request.response.writeln('Authorized'); + } else { + request.response.headers.add( + HttpHeaders.wwwAuthenticateHeader, 'Basic realm="Test realm"'); + request.response.statusCode = HttpStatus.unauthorized; + } + } else { + request.response.headers + .add(HttpHeaders.wwwAuthenticateHeader, 'Basic realm="Test realm"'); + request.response.statusCode = HttpStatus.unauthorized; + } } else { fail('unexpected request: ${request.method} ${request.uri}'); } @@ -41,6 +60,7 @@ Future main() async { final String primaryUrl = '$prefixUrl/hello.txt'; final String secondaryUrl = '$prefixUrl/secondary.txt'; final String headersUrl = '$prefixUrl/headers'; + final String basicAuthUrl = '$prefixUrl/http-basic-authentication'; testWidgets('loadRequest', (WidgetTester tester) async { final Completer pageFinished = Completer(); @@ -49,12 +69,9 @@ Future main() async { unawaited(controller.setNavigationDelegate( NavigationDelegate(onPageFinished: (_) => pageFinished.complete()), )); - unawaited(controller.loadRequest(Uri.parse(primaryUrl))); - await tester.pumpWidget(WebViewWidget(controller: controller)); - + unawaited(controller.loadRequest(Uri.parse(primaryUrl))); await pageFinished.future; - final String? currentUrl = await controller.currentUrl(); expect(currentUrl, primaryUrl); }); @@ -761,6 +778,54 @@ Future main() async { await expectLater(urlChangeCompleter.future, completion(secondaryUrl)); }); + + testWidgets('can receive HTTP basic auth requests', + (WidgetTester tester) async { + final Completer authRequested = Completer(); + final WebViewController controller = WebViewController(); + + unawaited( + controller.setNavigationDelegate( + NavigationDelegate( + onHttpAuthRequest: (HttpAuthRequest request) => + authRequested.complete(), + ), + ), + ); + + await tester.pumpWidget(WebViewWidget(controller: controller)); + + unawaited(controller.loadRequest(Uri.parse(basicAuthUrl))); + + await expectLater(authRequested.future, completes); + }); + + testWidgets('can authenticate to HTTP basic auth requests', + (WidgetTester tester) async { + final WebViewController controller = WebViewController(); + final Completer pageFinished = Completer(); + + unawaited( + controller.setNavigationDelegate( + NavigationDelegate( + onHttpAuthRequest: (HttpAuthRequest request) => request.onProceed( + const WebViewCredential( + user: 'user', + password: 'password', + ), + ), + onPageFinished: (_) => pageFinished.complete(), + onWebResourceError: (_) => fail('Authentication failed'), + ), + ), + ); + + await tester.pumpWidget(WebViewWidget(controller: controller)); + + unawaited(controller.loadRequest(Uri.parse(basicAuthUrl))); + + await expectLater(pageFinished.future, completes); + }); }); testWidgets('target _blank opens in same window', diff --git a/packages/webview_flutter/webview_flutter/example/ios/Runner.xcodeproj/project.pbxproj b/packages/webview_flutter/webview_flutter/example/ios/Runner.xcodeproj/project.pbxproj index f4a6c737e422..8c5cae5f9d0a 100644 --- a/packages/webview_flutter/webview_flutter/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/webview_flutter/webview_flutter/example/ios/Runner.xcodeproj/project.pbxproj @@ -274,7 +274,7 @@ isa = PBXProject; attributes = { DefaultBuildSystemTypeForWorkspace = Original; - LastUpgradeCheck = 1300; + LastUpgradeCheck = 1430; ORGANIZATIONNAME = "The Flutter Authors"; TargetAttributes = { 68BDCAE823C3F7CB00D9C032 = { diff --git a/packages/webview_flutter/webview_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/packages/webview_flutter/webview_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index cb713d767632..cf07c46df2ed 100644 --- a/packages/webview_flutter/webview_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/packages/webview_flutter/webview_flutter/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ openDialog(HttpAuthRequest httpRequest) async { + final TextEditingController usernameTextController = + TextEditingController(); + final TextEditingController passwordTextController = + TextEditingController(); + + return showDialog( + context: context, + barrierDismissible: false, + builder: (BuildContext context) { + return AlertDialog( + title: Text('${httpRequest.host}: ${httpRequest.realm ?? '-'}'), + content: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + TextField( + decoration: const InputDecoration(labelText: 'Username'), + autofocus: true, + controller: usernameTextController, + ), + TextField( + decoration: const InputDecoration(labelText: 'Password'), + controller: passwordTextController, + ), + ], + ), + ), + actions: [ + // Explicitly cancel the request on iOS as the OS does not emit new + // requests when a previous request is pending. + TextButton( + onPressed: () { + httpRequest.onCancel(); + Navigator.of(context).pop(); + }, + child: const Text('Cancel'), + ), + TextButton( + onPressed: () { + httpRequest.onProceed( + WebViewCredential( + user: usernameTextController.text, + password: passwordTextController.text, + ), + ); + Navigator.of(context).pop(); + }, + child: const Text('Authenticate'), + ), + ], + ); + }, + ); + } } enum MenuOptions { @@ -243,6 +302,7 @@ enum MenuOptions { transparentBackground, setCookie, logExample, + basicAuthentication, } class SampleMenu extends StatelessWidget { @@ -302,6 +362,9 @@ class SampleMenu extends StatelessWidget { case MenuOptions.logExample: _onLogExample(); break; + case MenuOptions.basicAuthentication: + _promptForUrl(context); + break; } }, itemBuilder: (BuildContext context) => >[ @@ -362,6 +425,10 @@ class SampleMenu extends StatelessWidget { value: MenuOptions.logExample, child: Text('Log example'), ), + const PopupMenuItem( + value: MenuOptions.basicAuthentication, + child: Text('Basic Authentication Example'), + ), ], ); } @@ -515,6 +582,38 @@ class SampleMenu extends StatelessWidget { return webViewController.loadHtmlString(kLogExamplePage); } + + Future _promptForUrl(BuildContext context) { + final TextEditingController urlTextController = TextEditingController(); + + return showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + title: const Text('Input URL to visit'), + content: TextField( + decoration: const InputDecoration(labelText: 'URL'), + autofocus: true, + controller: urlTextController, + ), + actions: [ + TextButton( + onPressed: () { + if (urlTextController.text.isNotEmpty) { + final Uri? uri = Uri.tryParse(urlTextController.text); + if (uri != null && uri.scheme.isNotEmpty) { + webViewController.loadRequest(uri); + Navigator.pop(context); + } + } + }, + child: const Text('Visit'), + ), + ], + ); + }, + ); + } } class NavigationControls extends StatelessWidget { diff --git a/packages/webview_flutter/webview_flutter/example/pubspec.yaml b/packages/webview_flutter/webview_flutter/example/pubspec.yaml index efc363539b79..b22903a0fc3e 100644 --- a/packages/webview_flutter/webview_flutter/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/example/pubspec.yaml @@ -17,8 +17,8 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - webview_flutter_android: ^3.12.0 - webview_flutter_wkwebview: ^3.9.0 + webview_flutter_android: ^3.13.0 + webview_flutter_wkwebview: ^3.10.0 dev_dependencies: build_runner: ^2.1.5 @@ -27,7 +27,6 @@ dev_dependencies: sdk: flutter integration_test: sdk: flutter - webview_flutter_platform_interface: ^2.3.0 flutter: uses-material-design: true diff --git a/packages/webview_flutter/webview_flutter/example/test/main_test.dart b/packages/webview_flutter/webview_flutter/example/test/main_test.dart index b1f36d364abd..c4b43428ec9e 100644 --- a/packages/webview_flutter/webview_flutter/example/test/main_test.dart +++ b/packages/webview_flutter/webview_flutter/example/test/main_test.dart @@ -116,4 +116,9 @@ class FakeNavigationDelegate extends PlatformNavigationDelegate { @override Future setOnUrlChange(UrlChangeCallback onUrlChange) async {} + + @override + Future setOnHttpAuthRequest( + HttpAuthRequestCallback handler, + ) async {} } diff --git a/packages/webview_flutter/webview_flutter/lib/src/navigation_delegate.dart b/packages/webview_flutter/webview_flutter/lib/src/navigation_delegate.dart index 9ca6981339d1..d1c5687c95a4 100644 --- a/packages/webview_flutter/webview_flutter/lib/src/navigation_delegate.dart +++ b/packages/webview_flutter/webview_flutter/lib/src/navigation_delegate.dart @@ -48,6 +48,7 @@ class NavigationDelegate { void Function(int progress)? onProgress, void Function(WebResourceError error)? onWebResourceError, void Function(UrlChange change)? onUrlChange, + void Function(HttpAuthRequest request)? onHttpAuthRequest, }) : this.fromPlatformCreationParams( const PlatformNavigationDelegateCreationParams(), onNavigationRequest: onNavigationRequest, @@ -56,6 +57,7 @@ class NavigationDelegate { onProgress: onProgress, onWebResourceError: onWebResourceError, onUrlChange: onUrlChange, + onHttpAuthRequest: onHttpAuthRequest, ); /// Constructs a [NavigationDelegate] from creation params for a specific @@ -98,6 +100,7 @@ class NavigationDelegate { void Function(int progress)? onProgress, void Function(WebResourceError error)? onWebResourceError, void Function(UrlChange change)? onUrlChange, + void Function(HttpAuthRequest request)? onHttpAuthRequest, }) : this.fromPlatform( PlatformNavigationDelegate(params), onNavigationRequest: onNavigationRequest, @@ -106,6 +109,7 @@ class NavigationDelegate { onProgress: onProgress, onWebResourceError: onWebResourceError, onUrlChange: onUrlChange, + onHttpAuthRequest: onHttpAuthRequest, ); /// Constructs a [NavigationDelegate] from a specific platform implementation. @@ -119,6 +123,7 @@ class NavigationDelegate { this.onProgress, this.onWebResourceError, void Function(UrlChange change)? onUrlChange, + HttpAuthRequestCallback? onHttpAuthRequest, }) { if (onNavigationRequest != null) { platform.setOnNavigationRequest(onNavigationRequest!); @@ -138,6 +143,9 @@ class NavigationDelegate { if (onUrlChange != null) { platform.setOnUrlChange(onUrlChange); } + if (onHttpAuthRequest != null) { + platform.setOnHttpAuthRequest(onHttpAuthRequest); + } } /// Implementation of [PlatformNavigationDelegate] for the current platform. diff --git a/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart b/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart index 4132a61cab73..b92c2fd90f82 100644 --- a/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart +++ b/packages/webview_flutter/webview_flutter/lib/webview_flutter.dart @@ -6,6 +6,7 @@ library webview_flutter; export 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart' show + HttpAuthRequest, JavaScriptConsoleMessage, JavaScriptLogLevel, JavaScriptMessage, @@ -26,6 +27,7 @@ export 'package:webview_flutter_platform_interface/webview_flutter_platform_inte WebResourceErrorCallback, WebResourceErrorType, WebViewCookie, + WebViewCredential, WebViewPermissionResourceType, WebViewPlatform; diff --git a/packages/webview_flutter/webview_flutter/pubspec.yaml b/packages/webview_flutter/webview_flutter/pubspec.yaml index 97ebe94ed0e9..ce3ab807331c 100644 --- a/packages/webview_flutter/webview_flutter/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter description: A Flutter plugin that provides a WebView widget on Android and iOS. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 4.4.2 +version: 4.5.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -19,9 +19,9 @@ flutter: dependencies: flutter: sdk: flutter - webview_flutter_android: ^3.12.0 - webview_flutter_platform_interface: ^2.6.0 - webview_flutter_wkwebview: ^3.9.0 + webview_flutter_android: ^3.13.0 + webview_flutter_platform_interface: ^2.7.0 + webview_flutter_wkwebview: ^3.10.0 dev_dependencies: build_runner: ^2.1.5 @@ -34,3 +34,8 @@ topics: - html - webview - webview-flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {webview_flutter_android: {path: ../../webview_flutter/webview_flutter_android}, webview_flutter_platform_interface: {path: ../../webview_flutter/webview_flutter_platform_interface}, webview_flutter_wkwebview: {path: ../../webview_flutter/webview_flutter_wkwebview}} diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.dart index ffd97718bd40..c2bc6f230fa5 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.dart +++ b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.dart @@ -87,6 +87,18 @@ void main() { verify(delegate.platform.setOnUrlChange(onUrlChange)); }); + + test('onHttpAuthRequest', () { + WebViewPlatform.instance = TestWebViewPlatform(); + + void onHttpAuthRequest(HttpAuthRequest request) {} + + final NavigationDelegate delegate = NavigationDelegate( + onHttpAuthRequest: onHttpAuthRequest, + ); + + verify(delegate.platform.setOnHttpAuthRequest(onHttpAuthRequest)); + }); }); } diff --git a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart index ccf3c4b3bff0..08bfec791b74 100644 --- a/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/navigation_delegate_test.mocks.dart @@ -260,4 +260,15 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i8.Future.value(), returnValueForMissingStub: _i8.Future.value(), ) as _i8.Future); + @override + _i8.Future setOnHttpAuthRequest( + _i3.HttpAuthRequestCallback? onHttpAuthRequest) => + (super.noSuchMethod( + Invocation.method( + #setOnHttpAuthRequest, + [onHttpAuthRequest], + ), + returnValue: _i8.Future.value(), + returnValueForMissingStub: _i8.Future.value(), + ) as _i8.Future); } diff --git a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart index 383751f38bcc..ed946948011c 100644 --- a/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter/test/webview_controller_test.mocks.dart @@ -501,4 +501,15 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); + @override + _i5.Future setOnHttpAuthRequest( + _i6.HttpAuthRequestCallback? onHttpAuthRequest) => + (super.noSuchMethod( + Invocation.method( + #setOnHttpAuthRequest, + [onHttpAuthRequest], + ), + returnValue: _i5.Future.value(), + returnValueForMissingStub: _i5.Future.value(), + ) as _i5.Future); } diff --git a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md index 09f214c71b3e..5767150a0bb2 100644 --- a/packages/webview_flutter/webview_flutter_android/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_android/CHANGELOG.md @@ -1,7 +1,3 @@ -## 3.13.1 - -* Bumps androidx.annotation:annotation from 1.7.0 to 1.7.1. - ## 3.13.0 * Adds support for `PlatformNavigationDelegate.setOnHttpAuthRequest`. diff --git a/packages/webview_flutter/webview_flutter_android/android/build.gradle b/packages/webview_flutter/webview_flutter_android/android/build.gradle index 3e2ffff1e0b1..632c909dc16f 100644 --- a/packages/webview_flutter/webview_flutter_android/android/build.gradle +++ b/packages/webview_flutter/webview_flutter_android/android/build.gradle @@ -40,7 +40,7 @@ android { } dependencies { - implementation 'androidx.annotation:annotation:1.7.1' + implementation 'androidx.annotation:annotation:1.7.0' implementation 'androidx.webkit:webkit:1.7.0' testImplementation 'junit:junit:4.13.2' testImplementation 'org.mockito:mockito-inline:5.1.0' diff --git a/packages/webview_flutter/webview_flutter_android/example/android/app/gradle/wrapper/gradle-wrapper.properties b/packages/webview_flutter/webview_flutter_android/example/android/app/gradle/wrapper/gradle-wrapper.properties index 609ab8e6c8b5..31cca4913088 100644 --- a/packages/webview_flutter/webview_flutter_android/example/android/app/gradle/wrapper/gradle-wrapper.properties +++ b/packages/webview_flutter/webview_flutter_android/example/android/app/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/packages/webview_flutter/webview_flutter_android/example/android/gradle/wrapper/gradle-wrapper.properties b/packages/webview_flutter/webview_flutter_android/example/android/gradle/wrapper/gradle-wrapper.properties index aeaff6f869f3..cfe88f6904c9 100644 --- a/packages/webview_flutter/webview_flutter_android/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/packages/webview_flutter/webview_flutter_android/example/android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip diff --git a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml index 337a70d06a33..baed2e5489a2 100644 --- a/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/example/pubspec.yaml @@ -17,7 +17,7 @@ dependencies: # The example app is bundled with the plugin so we use a path dependency on # the parent directory to use the current plugin's version. path: ../ - webview_flutter_platform_interface: ^2.7.0 + webview_flutter_platform_interface: ^2.6.0 dev_dependencies: espresso: ^0.2.0 @@ -33,3 +33,8 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {webview_flutter_android: {path: ../../../webview_flutter/webview_flutter_android}, webview_flutter_platform_interface: {path: ../../../webview_flutter/webview_flutter_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart index bb90f393cddb..c7f3af8f5076 100644 --- a/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart @@ -1289,8 +1289,6 @@ class AndroidNavigationDelegate extends PlatformNavigationDelegate { realm: realm, ), ); - } else { - httpAuthHandler.cancel(); } }, ); diff --git a/packages/webview_flutter/webview_flutter_android/pubspec.yaml b/packages/webview_flutter/webview_flutter_android/pubspec.yaml index d9c7adf6abac..aaadd6da6975 100644 --- a/packages/webview_flutter/webview_flutter_android/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_android/pubspec.yaml @@ -2,7 +2,7 @@ name: webview_flutter_android description: A Flutter plugin that provides a WebView widget on Android. repository: https://github.com/flutter/packages/tree/main/packages/webview_flutter/webview_flutter_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview%22 -version: 3.13.1 +version: 3.13.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -26,10 +26,15 @@ dev_dependencies: build_runner: ^2.1.4 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^11.0.0 topics: - html - webview - webview-flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {webview_flutter_platform_interface: {path: ../../webview_flutter/webview_flutter_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart index 1386f046d2b3..37eaec813c02 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_navigation_delegate_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_android/test/android_navigation_delegate_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_android_webview.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart index c50a1b065f63..e09c9d77b889 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_controller_test.mocks.dart @@ -1,17 +1,18 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_android/test/android_webview_controller_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i9; -import 'dart:typed_data' as _i14; +import 'dart:typed_data' as _i13; import 'dart:ui' as _i4; import 'package:flutter/foundation.dart' as _i11; import 'package:flutter/gestures.dart' as _i12; import 'package:flutter/services.dart' as _i7; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i13; import 'package:webview_flutter_android/src/android_proxy.dart' as _i10; import 'package:webview_flutter_android/src/android_webview.dart' as _i2; import 'package:webview_flutter_android/src/android_webview_controller.dart' @@ -22,14 +23,12 @@ import 'package:webview_flutter_android/src/platform_views_service_proxy.dart' import 'package:webview_flutter_platform_interface/webview_flutter_platform_interface.dart' as _i3; -import 'test_android_webview.g.dart' as _i15; +import 'test_android_webview.g.dart' as _i14; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -1455,21 +1454,8 @@ class MockFlutterAssetManager extends _i1.Mock #getAssetFilePathByName, [name], ), - returnValue: _i9.Future.value(_i13.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], - ), - )), - returnValueForMissingStub: - _i9.Future.value(_i13.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], - ), - )), + returnValue: _i9.Future.value(''), + returnValueForMissingStub: _i9.Future.value(''), ) as _i9.Future); } @@ -1480,14 +1466,8 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { @override String get channelName => (super.noSuchMethod( Invocation.getter(#channelName), - returnValue: _i13.dummyValue( - this, - Invocation.getter(#channelName), - ), - returnValueForMissingStub: _i13.dummyValue( - this, - Invocation.getter(#channelName), - ), + returnValue: '', + returnValueForMissingStub: '', ) as String); @override void Function(String) get postMessage => (super.noSuchMethod( @@ -2035,21 +2015,8 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { #getUserAgentString, [], ), - returnValue: _i9.Future.value(_i13.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], - ), - )), - returnValueForMissingStub: - _i9.Future.value(_i13.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], - ), - )), + returnValue: _i9.Future.value(''), + returnValueForMissingStub: _i9.Future.value(''), ) as _i9.Future); @override _i2.WebSettings copy() => (super.noSuchMethod( @@ -2151,7 +2118,7 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i9.Future postUrl( String? url, - _i14.Uint8List? data, + _i13.Uint8List? data, ) => (super.noSuchMethod( Invocation.method( @@ -2566,7 +2533,7 @@ class MockInstanceManager extends _i1.Mock implements _i5.InstanceManager { /// /// See the documentation for Mockito's code generation for more information. class MockTestInstanceManagerHostApi extends _i1.Mock - implements _i15.TestInstanceManagerHostApi { + implements _i14.TestInstanceManagerHostApi { @override void clear() => super.noSuchMethod( Invocation.method( diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart index 8c96ec1ae752..5213793ee9e9 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_cookie_manager_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_android/test/android_webview_cookie_manager_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:ui' as _i4; @@ -19,8 +21,6 @@ import 'test_android_webview.g.dart' as _i7; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart index be222bd74125..4a6130f13adf 100644 --- a/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/android_webview_test.mocks.dart @@ -1,25 +1,24 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_android/test/android_webview_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; -import 'dart:typed_data' as _i8; +import 'dart:typed_data' as _i7; import 'dart:ui' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i6; import 'package:webview_flutter_android/src/android_webview.dart' as _i2; import 'package:webview_flutter_android/src/android_webview.g.dart' as _i3; -import 'test_android_webview.g.dart' as _i7; +import 'test_android_webview.g.dart' as _i6; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -233,10 +232,7 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { @override String get channelName => (super.noSuchMethod( Invocation.getter(#channelName), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#channelName), - ), + returnValue: '', ) as String); @override void Function(String) get postMessage => (super.noSuchMethod( @@ -263,7 +259,7 @@ class MockJavaScriptChannel extends _i1.Mock implements _i2.JavaScriptChannel { /// /// See the documentation for Mockito's code generation for more information. class MockTestCookieManagerHostApi extends _i1.Mock - implements _i7.TestCookieManagerHostApi { + implements _i6.TestCookieManagerHostApi { MockTestCookieManagerHostApi() { _i1.throwOnMissingStub(this); } @@ -324,7 +320,7 @@ class MockTestCookieManagerHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestCustomViewCallbackHostApi extends _i1.Mock - implements _i7.TestCustomViewCallbackHostApi { + implements _i6.TestCustomViewCallbackHostApi { MockTestCustomViewCallbackHostApi() { _i1.throwOnMissingStub(this); } @@ -343,7 +339,7 @@ class MockTestCustomViewCallbackHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestDownloadListenerHostApi extends _i1.Mock - implements _i7.TestDownloadListenerHostApi { + implements _i6.TestDownloadListenerHostApi { MockTestDownloadListenerHostApi() { _i1.throwOnMissingStub(this); } @@ -362,7 +358,7 @@ class MockTestDownloadListenerHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestGeolocationPermissionsCallbackHostApi extends _i1.Mock - implements _i7.TestGeolocationPermissionsCallbackHostApi { + implements _i6.TestGeolocationPermissionsCallbackHostApi { MockTestGeolocationPermissionsCallbackHostApi() { _i1.throwOnMissingStub(this); } @@ -392,7 +388,7 @@ class MockTestGeolocationPermissionsCallbackHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestInstanceManagerHostApi extends _i1.Mock - implements _i7.TestInstanceManagerHostApi { + implements _i6.TestInstanceManagerHostApi { MockTestInstanceManagerHostApi() { _i1.throwOnMissingStub(this); } @@ -411,7 +407,7 @@ class MockTestInstanceManagerHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestJavaObjectHostApi extends _i1.Mock - implements _i7.TestJavaObjectHostApi { + implements _i6.TestJavaObjectHostApi { MockTestJavaObjectHostApi() { _i1.throwOnMissingStub(this); } @@ -430,7 +426,7 @@ class MockTestJavaObjectHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestJavaScriptChannelHostApi extends _i1.Mock - implements _i7.TestJavaScriptChannelHostApi { + implements _i6.TestJavaScriptChannelHostApi { MockTestJavaScriptChannelHostApi() { _i1.throwOnMissingStub(this); } @@ -456,7 +452,7 @@ class MockTestJavaScriptChannelHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestWebChromeClientHostApi extends _i1.Mock - implements _i7.TestWebChromeClientHostApi { + implements _i6.TestWebChromeClientHostApi { MockTestWebChromeClientHostApi() { _i1.throwOnMissingStub(this); } @@ -505,7 +501,7 @@ class MockTestWebChromeClientHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestWebSettingsHostApi extends _i1.Mock - implements _i7.TestWebSettingsHostApi { + implements _i6.TestWebSettingsHostApi { MockTestWebSettingsHostApi() { _i1.throwOnMissingStub(this); } @@ -726,13 +722,7 @@ class MockTestWebSettingsHostApi extends _i1.Mock #getUserAgentString, [instanceId], ), - returnValue: _i6.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [instanceId], - ), - ), + returnValue: '', ) as String); } @@ -740,7 +730,7 @@ class MockTestWebSettingsHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestWebStorageHostApi extends _i1.Mock - implements _i7.TestWebStorageHostApi { + implements _i6.TestWebStorageHostApi { MockTestWebStorageHostApi() { _i1.throwOnMissingStub(this); } @@ -767,7 +757,7 @@ class MockTestWebStorageHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestWebViewClientHostApi extends _i1.Mock - implements _i7.TestWebViewClientHostApi { + implements _i6.TestWebViewClientHostApi { MockTestWebViewClientHostApi() { _i1.throwOnMissingStub(this); } @@ -801,7 +791,7 @@ class MockTestWebViewClientHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestWebViewHostApi extends _i1.Mock - implements _i7.TestWebViewHostApi { + implements _i6.TestWebViewHostApi { MockTestWebViewHostApi() { _i1.throwOnMissingStub(this); } @@ -877,7 +867,7 @@ class MockTestWebViewHostApi extends _i1.Mock void postUrl( int? instanceId, String? url, - _i8.Uint8List? data, + _i7.Uint8List? data, ) => super.noSuchMethod( Invocation.method( @@ -1138,7 +1128,7 @@ class MockTestWebViewHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestAssetManagerHostApi extends _i1.Mock - implements _i7.TestAssetManagerHostApi { + implements _i6.TestAssetManagerHostApi { MockTestAssetManagerHostApi() { _i1.throwOnMissingStub(this); } @@ -1157,13 +1147,7 @@ class MockTestAssetManagerHostApi extends _i1.Mock #getAssetFilePathByName, [name], ), - returnValue: _i6.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], - ), - ), + returnValue: '', ) as String); } @@ -1171,7 +1155,7 @@ class MockTestAssetManagerHostApi extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockTestPermissionRequestHostApi extends _i1.Mock - implements _i7.TestPermissionRequestHostApi { + implements _i6.TestPermissionRequestHostApi { MockTestPermissionRequestHostApi() { _i1.throwOnMissingStub(this); } @@ -1322,7 +1306,7 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i5.Future postUrl( String? url, - _i8.Uint8List? data, + _i7.Uint8List? data, ) => (super.noSuchMethod( Invocation.method( diff --git a/packages/webview_flutter/webview_flutter_android/test/instance_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/instance_manager_test.mocks.dart index 8bff8b50143c..d071991ab0c4 100644 --- a/packages/webview_flutter/webview_flutter_android/test/instance_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/instance_manager_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_android/test/instance_manager_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; @@ -11,8 +13,6 @@ import 'test_android_webview.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart index a10f530f2e33..df06f6252274 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_cookie_manager_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_android/test/legacy/webview_android_cookie_manager_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -12,8 +14,6 @@ import 'package:webview_flutter_android/src/android_webview.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors diff --git a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart index 9cdf0fbcc922..19e03b393bdd 100644 --- a/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_android/test/legacy/webview_android_widget_test.mocks.dart @@ -1,17 +1,18 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_android/test/legacy/webview_android_widget_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; -import 'dart:typed_data' as _i7; +import 'dart:typed_data' as _i6; import 'dart:ui' as _i3; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i6; import 'package:webview_flutter_android/src/android_webview.dart' as _i2; import 'package:webview_flutter_android/src/legacy/webview_android_widget.dart' - as _i8; + as _i7; import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_interface_legacy.dart' as _i4; @@ -19,8 +20,6 @@ import 'package:webview_flutter_platform_interface/src/webview_flutter_platform_ // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -146,13 +145,7 @@ class MockFlutterAssetManager extends _i1.Mock #getAssetFilePathByName, [name], ), - returnValue: _i5.Future.value(_i6.dummyValue( - this, - Invocation.method( - #getAssetFilePathByName, - [name], - ), - )), + returnValue: _i5.Future.value(''), ) as _i5.Future); } @@ -292,13 +285,7 @@ class MockWebSettings extends _i1.Mock implements _i2.WebSettings { #getUserAgentString, [], ), - returnValue: _i5.Future.value(_i6.dummyValue( - this, - Invocation.method( - #getUserAgentString, - [], - ), - )), + returnValue: _i5.Future.value(''), ) as _i5.Future); @override _i2.WebSettings copy() => (super.noSuchMethod( @@ -426,7 +413,7 @@ class MockWebView extends _i1.Mock implements _i2.WebView { @override _i5.Future postUrl( String? url, - _i7.Uint8List? data, + _i6.Uint8List? data, ) => (super.noSuchMethod( Invocation.method( @@ -667,10 +654,7 @@ class MockWebResourceRequest extends _i1.Mock @override String get url => (super.noSuchMethod( Invocation.getter(#url), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#url), - ), + returnValue: '', ) as String); @override bool get isForMainFrame => (super.noSuchMethod( @@ -685,10 +669,7 @@ class MockWebResourceRequest extends _i1.Mock @override String get method => (super.noSuchMethod( Invocation.getter(#method), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#method), - ), + returnValue: '', ) as String); @override Map get requestHeaders => (super.noSuchMethod( @@ -748,7 +729,7 @@ class MockDownloadListener extends _i1.Mock implements _i2.DownloadListener { /// /// See the documentation for Mockito's code generation for more information. class MockWebViewAndroidJavaScriptChannel extends _i1.Mock - implements _i8.WebViewAndroidJavaScriptChannel { + implements _i7.WebViewAndroidJavaScriptChannel { MockWebViewAndroidJavaScriptChannel() { _i1.throwOnMissingStub(this); } @@ -765,10 +746,7 @@ class MockWebViewAndroidJavaScriptChannel extends _i1.Mock @override String get channelName => (super.noSuchMethod( Invocation.getter(#channelName), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#channelName), - ), + returnValue: '', ) as String); @override void Function(String) get postMessage => (super.noSuchMethod( @@ -972,7 +950,7 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock /// A class which mocks [WebViewProxy]. /// /// See the documentation for Mockito's code generation for more information. -class MockWebViewProxy extends _i1.Mock implements _i8.WebViewProxy { +class MockWebViewProxy extends _i1.Mock implements _i7.WebViewProxy { MockWebViewProxy() { _i1.throwOnMissingStub(this); } diff --git a/packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md b/packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md index 4c41f54060f8..63074b81e48e 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md +++ b/packages/webview_flutter/webview_flutter_platform_interface/CHANGELOG.md @@ -1,11 +1,3 @@ -## 2.9.0 - -* Adds support to show JavaScript dialog. See `PlatformWebViewController.setOnJavaScriptAlertDialog`, `PlatformWebViewController.setOnJavaScriptConfirmDialog` and `PlatformWebViewController.setOnJavaScriptTextInputDialog`. - -## 2.8.0 - -* Adds support to track scroll position changes. See `PlatformWebViewController.setOnScrollPositionChange`. - ## 2.7.0 * Adds support for handling HTTP basic authentication requests. See `PlatformNavigationDelegate.setOnHttpAuthRequest`. diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart index 2aaabb519ccc..d81cdaf23512 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/platform_webview_controller.dart @@ -286,44 +286,6 @@ abstract class PlatformWebViewController extends PlatformInterface { 'setOnConsoleMessage is not implemented on the current platform', ); } - - /// Sets the listener for content offset changes. - Future setOnScrollPositionChange( - void Function(ScrollPositionChange scrollPositionChange)? - onScrollPositionChange) { - throw UnimplementedError( - 'setOnScrollPositionChange is not implemented on the current platform'); - } - - /// Sets a callback that notifies the host application that the web page - /// wants to display a JavaScript alert() dialog. - Future setOnJavaScriptAlertDialog( - Future Function(JavaScriptAlertDialogRequest request) - onJavaScriptAlertDialog) async { - throw UnimplementedError( - 'setOnJavaScriptAlertDialog is not implemented on the current platform', - ); - } - - /// Sets a callback that notifies the host application that the web page - /// wants to display a JavaScript confirm() dialog. - Future setOnJavaScriptConfirmDialog( - Future Function(JavaScriptConfirmDialogRequest request) - onJavaScriptConfirmDialog) async { - throw UnimplementedError( - 'setOnJavaScriptConfirmDialog is not implemented on the current platform', - ); - } - - /// Sets a callback that notifies the host application that the web page - /// wants to display a JavaScript prompt() dialog. - Future setOnJavaScriptTextInputDialog( - Future Function(JavaScriptTextInputDialogRequest request) - onJavaScriptTextInputDialog) async { - throw UnimplementedError( - 'setOnJavaScriptTextInputDialog is not implemented on the current platform', - ); - } } /// Describes the parameters necessary for registering a JavaScript channel. diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/javascript_dialog_request.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/javascript_dialog_request.dart deleted file mode 100644 index db367bd7e62a..000000000000 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/javascript_dialog_request.dart +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import 'package:flutter/foundation.dart'; - -/// Defines the parameters that support `PlatformWebViewController.setOnJavaScriptAlertDialog`. -@immutable -class JavaScriptAlertDialogRequest { - /// Creates a [JavaScriptAlertDialogRequest]. - const JavaScriptAlertDialogRequest({ - required this.message, - required this.url, - }); - - /// The message to be displayed in the window. - final String message; - - /// The URL of the page requesting the dialog. - final String url; -} - -/// Defines the parameters that support `PlatformWebViewController.setOnJavaScriptConfirmDialog`. -@immutable -class JavaScriptConfirmDialogRequest { - /// Creates a [JavaScriptConfirmDialogRequest]. - const JavaScriptConfirmDialogRequest({ - required this.message, - required this.url, - }); - - /// The message to be displayed in the window. - final String message; - - /// The URL of the page requesting the dialog. - final String url; -} - -/// Defines the parameters that support `PlatformWebViewController.setOnJavaScriptTextInputDialog`. -@immutable -class JavaScriptTextInputDialogRequest { - /// Creates a [JavaScriptAlertDialogRequest]. - const JavaScriptTextInputDialogRequest({ - required this.message, - required this.url, - required this.defaultText, - }); - - /// The message to be displayed in the window. - final String message; - - /// The URL of the page requesting the dialog. - final String url; - - /// The initial text to display in the text entry field. - final String? defaultText; -} diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/scroll_position_change.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/scroll_position_change.dart deleted file mode 100644 index dab68d491889..000000000000 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/scroll_position_change.dart +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -/// Defines the parameters of the scroll position change callback. -class ScrollPositionChange { - /// Creates a [ScrollPositionChange]. - const ScrollPositionChange(this.x, this.y); - - /// The value of the horizontal offset with the origin being at the leftmost - /// of the `WebView`. - final double x; - - /// The value of the vertical offset with the origin being at the topmost of - /// the `WebView`. - final double y; -} diff --git a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/types.dart b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/types.dart index c89f32a238fb..d1a074f79257 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/types.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/lib/src/types/types.dart @@ -5,7 +5,6 @@ export 'http_auth_request.dart'; export 'http_response_error.dart'; export 'javascript_console_message.dart'; -export 'javascript_dialog_request.dart'; export 'javascript_log_level.dart'; export 'javascript_message.dart'; export 'javascript_mode.dart'; @@ -17,7 +16,6 @@ export 'platform_webview_controller_creation_params.dart'; export 'platform_webview_cookie_manager_creation_params.dart'; export 'platform_webview_permission_request.dart'; export 'platform_webview_widget_creation_params.dart'; -export 'scroll_position_change.dart'; export 'url_change.dart'; export 'web_resource_error.dart'; export 'webview_cookie.dart'; diff --git a/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml b/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml index 1a900c2b4d42..94bd51f9cab5 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_platform_interface/pubspec.yaml @@ -4,7 +4,7 @@ repository: https://github.com/flutter/packages/tree/main/packages/webview_flutt issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+webview_flutter%22 # NOTE: We strongly prefer non-breaking changes, even at the expense of a # less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes -version: 2.9.0 +version: 2.7.0 environment: sdk: ">=3.0.0 <4.0.0" @@ -14,13 +14,13 @@ dependencies: flutter: sdk: flutter meta: ^1.7.0 - plugin_platform_interface: ^2.1.0 + plugin_platform_interface: ^2.1.6 dev_dependencies: build_runner: ^2.1.8 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - html diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart index db3cf1dd5d6f..ba83cc119922 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.dart @@ -414,49 +414,6 @@ void main() { throwsUnimplementedError, ); }); - - test( - 'Default implementation of setOnJavaScriptAlertDialog should throw unimplemented error', - () { - final PlatformWebViewController controller = - ExtendsPlatformWebViewController( - const PlatformWebViewControllerCreationParams()); - - expect( - () => controller.setOnJavaScriptAlertDialog((_) async {}), - throwsUnimplementedError, - ); - }); - - test( - 'Default implementation of setOnJavaScriptConfirmDialog should throw unimplemented error', - () { - final PlatformWebViewController controller = - ExtendsPlatformWebViewController( - const PlatformWebViewControllerCreationParams()); - - expect( - () => controller.setOnJavaScriptConfirmDialog((_) async { - return false; - }), - throwsUnimplementedError, - ); - }); - - test( - 'Default implementation of setOnJavaScriptTextInputDialog should throw unimplemented error', - () { - final PlatformWebViewController controller = - ExtendsPlatformWebViewController( - const PlatformWebViewControllerCreationParams()); - - expect( - () => controller.setOnJavaScriptTextInputDialog((_) async { - return ''; - }), - throwsUnimplementedError, - ); - }); } class MockWebViewPlatformWithMixin extends MockWebViewPlatform diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.mocks.dart index 747c29dfd7f7..88d5af24ed76 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/platform_webview_controller_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_platform_interface/test/platform_webview_controller_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; @@ -14,8 +16,6 @@ import 'package:webview_flutter_platform_interface/src/types/types.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -52,7 +52,6 @@ class MockPlatformNavigationDelegate extends _i1.Mock Invocation.getter(#params), ), ) as _i2.PlatformNavigationDelegateCreationParams); - @override _i4.Future setOnNavigationRequest( _i3.NavigationRequestCallback? onNavigationRequest) => @@ -64,7 +63,6 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future setOnPageStarted(_i3.PageEventCallback? onPageStarted) => (super.noSuchMethod( @@ -75,7 +73,6 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future setOnPageFinished(_i3.PageEventCallback? onPageFinished) => (super.noSuchMethod( @@ -86,7 +83,6 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future setOnHttpError(_i3.HttpResponseErrorCallback? onHttpError) => (super.noSuchMethod( @@ -97,7 +93,6 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future setOnProgress(_i3.ProgressCallback? onProgress) => (super.noSuchMethod( @@ -108,7 +103,6 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future setOnWebResourceError( _i3.WebResourceErrorCallback? onWebResourceError) => @@ -120,7 +114,6 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future setOnUrlChange(_i3.UrlChangeCallback? onUrlChange) => (super.noSuchMethod( @@ -131,7 +124,6 @@ class MockPlatformNavigationDelegate extends _i1.Mock returnValue: _i4.Future.value(), returnValueForMissingStub: _i4.Future.value(), ) as _i4.Future); - @override _i4.Future setOnHttpAuthRequest( _i3.HttpAuthRequestCallback? onHttpAuthRequest) => diff --git a/packages/webview_flutter/webview_flutter_platform_interface/test/webview_platform_test.mocks.dart b/packages/webview_flutter/webview_flutter_platform_interface/test/webview_platform_test.mocks.dart index d7dd933bc476..7b6d661a4c29 100644 --- a/packages/webview_flutter/webview_flutter_platform_interface/test/webview_platform_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_platform_interface/test/webview_platform_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_platform_interface/test/webview_platform_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; import 'package:webview_flutter_platform_interface/src/platform_navigation_delegate.dart' @@ -20,8 +22,6 @@ import 'package:webview_flutter_platform_interface/src/webview_platform.dart' // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -97,7 +97,6 @@ class MockWebViewPlatform extends _i1.Mock implements _i6.WebViewPlatform { ), ), ) as _i2.PlatformWebViewCookieManager); - @override _i3.PlatformNavigationDelegate createPlatformNavigationDelegate( _i7.PlatformNavigationDelegateCreationParams? params) => @@ -114,7 +113,6 @@ class MockWebViewPlatform extends _i1.Mock implements _i6.WebViewPlatform { ), ), ) as _i3.PlatformNavigationDelegate); - @override _i4.PlatformWebViewController createPlatformWebViewController( _i7.PlatformWebViewControllerCreationParams? params) => @@ -131,7 +129,6 @@ class MockWebViewPlatform extends _i1.Mock implements _i6.WebViewPlatform { ), ), ) as _i4.PlatformWebViewController); - @override _i5.PlatformWebViewWidget createPlatformWebViewWidget( _i7.PlatformWebViewWidgetCreationParams? params) => diff --git a/packages/webview_flutter/webview_flutter_web/pubspec.yaml b/packages/webview_flutter/webview_flutter_web/pubspec.yaml index 2420900ec29c..ed646b435332 100644 --- a/packages/webview_flutter/webview_flutter_web/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_web/pubspec.yaml @@ -27,7 +27,7 @@ dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 topics: - html diff --git a/packages/webview_flutter/webview_flutter_web/test/legacy/webview_flutter_web_test.mocks.dart b/packages/webview_flutter/webview_flutter_web/test/legacy/webview_flutter_web_test.mocks.dart index 0de74c0d7224..06b57106e2b4 100644 --- a/packages/webview_flutter/webview_flutter_web/test/legacy/webview_flutter_web_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_web/test/legacy/webview_flutter_web_test.mocks.dart @@ -1,29 +1,26 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in webview_flutter_web/test/legacy/webview_flutter_web_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i7; +import 'dart:async' as _i6; import 'dart:html' as _i2; import 'dart:math' as _i3; import 'package:flutter/foundation.dart' as _i5; -import 'package:flutter/src/widgets/notification_listener.dart' as _i8; +import 'package:flutter/src/widgets/notification_listener.dart' as _i7; import 'package:flutter/widgets.dart' as _i4; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i6; import 'package:webview_flutter_platform_interface/src/legacy/platform_interface/webview_platform_callbacks_handler.dart' - as _i10; -import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart' as _i9; -import 'package:webview_flutter_web/src/http_request_factory.dart' as _i11; +import 'package:webview_flutter_platform_interface/src/legacy/types/types.dart' + as _i8; +import 'package:webview_flutter_web/src/http_request_factory.dart' as _i10; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -105,8 +102,8 @@ class _FakeElementStream_6 extends _i1.SmartFake ); } -class _FakeElementList_7 extends _i1.SmartFake - implements _i2.ElementList { +class _FakeElementList_7 extends _i1.SmartFake + implements _i2.ElementList { _FakeElementList_7( Object parent, Invocation parentInvocation, @@ -271,7 +268,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set allowFullscreen(bool? value) => super.noSuchMethod( Invocation.setter( @@ -280,7 +276,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set allowPaymentRequest(bool? value) => super.noSuchMethod( Invocation.setter( @@ -289,7 +284,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set csp(String? value) => super.noSuchMethod( Invocation.setter( @@ -298,7 +292,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set height(String? value) => super.noSuchMethod( Invocation.setter( @@ -307,7 +300,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set name(String? value) => super.noSuchMethod( Invocation.setter( @@ -316,7 +308,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set referrerPolicy(String? value) => super.noSuchMethod( Invocation.setter( @@ -325,7 +316,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set src(String? value) => super.noSuchMethod( Invocation.setter( @@ -334,7 +324,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set srcdoc(String? value) => super.noSuchMethod( Invocation.setter( @@ -343,7 +332,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set width(String? value) => super.noSuchMethod( Invocation.setter( @@ -352,7 +340,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set nonce(String? value) => super.noSuchMethod( Invocation.setter( @@ -361,13 +348,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override Map get attributes => (super.noSuchMethod( Invocation.getter(#attributes), returnValue: {}, ) as Map); - @override set attributes(Map? value) => super.noSuchMethod( Invocation.setter( @@ -376,13 +361,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override List<_i2.Element> get children => (super.noSuchMethod( Invocation.getter(#children), returnValue: <_i2.Element>[], ) as List<_i2.Element>); - @override set children(List<_i2.Element>? value) => super.noSuchMethod( Invocation.setter( @@ -391,7 +374,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.CssClassSet get classes => (super.noSuchMethod( Invocation.getter(#classes), @@ -400,7 +382,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#classes), ), ) as _i2.CssClassSet); - @override set classes(Iterable? value) => super.noSuchMethod( Invocation.setter( @@ -409,13 +390,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override Map get dataset => (super.noSuchMethod( Invocation.getter(#dataset), returnValue: {}, ) as Map); - @override set dataset(Map? value) => super.noSuchMethod( Invocation.setter( @@ -424,7 +403,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i3.Rectangle get client => (super.noSuchMethod( Invocation.getter(#client), @@ -433,7 +411,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#client), ), ) as _i3.Rectangle); - @override _i3.Rectangle get offset => (super.noSuchMethod( Invocation.getter(#offset), @@ -442,16 +419,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#offset), ), ) as _i3.Rectangle); - @override String get localName => (super.noSuchMethod( Invocation.getter(#localName), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#localName), - ), + returnValue: '', ) as String); - @override _i2.CssRect get contentEdge => (super.noSuchMethod( Invocation.getter(#contentEdge), @@ -460,7 +432,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#contentEdge), ), ) as _i2.CssRect); - @override _i2.CssRect get paddingEdge => (super.noSuchMethod( Invocation.getter(#paddingEdge), @@ -469,7 +440,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#paddingEdge), ), ) as _i2.CssRect); - @override _i2.CssRect get borderEdge => (super.noSuchMethod( Invocation.getter(#borderEdge), @@ -478,7 +448,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#borderEdge), ), ) as _i2.CssRect); - @override _i2.CssRect get marginEdge => (super.noSuchMethod( Invocation.getter(#marginEdge), @@ -487,7 +456,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#marginEdge), ), ) as _i2.CssRect); - @override _i3.Point get documentOffset => (super.noSuchMethod( Invocation.getter(#documentOffset), @@ -496,7 +464,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#documentOffset), ), ) as _i3.Point); - @override set innerHtml(String? html) => super.noSuchMethod( Invocation.setter( @@ -505,16 +472,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override String get innerText => (super.noSuchMethod( Invocation.getter(#innerText), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#innerText), - ), + returnValue: '', ) as String); - @override set innerText(String? value) => super.noSuchMethod( Invocation.setter( @@ -523,7 +485,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.ElementEvents get on => (super.noSuchMethod( Invocation.getter(#on), @@ -532,43 +493,36 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#on), ), ) as _i2.ElementEvents); - @override int get offsetHeight => (super.noSuchMethod( Invocation.getter(#offsetHeight), returnValue: 0, ) as int); - @override int get offsetLeft => (super.noSuchMethod( Invocation.getter(#offsetLeft), returnValue: 0, ) as int); - @override int get offsetTop => (super.noSuchMethod( Invocation.getter(#offsetTop), returnValue: 0, ) as int); - @override int get offsetWidth => (super.noSuchMethod( Invocation.getter(#offsetWidth), returnValue: 0, ) as int); - @override int get scrollHeight => (super.noSuchMethod( Invocation.getter(#scrollHeight), returnValue: 0, ) as int); - @override int get scrollLeft => (super.noSuchMethod( Invocation.getter(#scrollLeft), returnValue: 0, ) as int); - @override set scrollLeft(int? value) => super.noSuchMethod( Invocation.setter( @@ -577,13 +531,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override int get scrollTop => (super.noSuchMethod( Invocation.getter(#scrollTop), returnValue: 0, ) as int); - @override set scrollTop(int? value) => super.noSuchMethod( Invocation.setter( @@ -592,22 +544,16 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override int get scrollWidth => (super.noSuchMethod( Invocation.getter(#scrollWidth), returnValue: 0, ) as int); - @override String get contentEditable => (super.noSuchMethod( Invocation.getter(#contentEditable), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#contentEditable), - ), + returnValue: '', ) as String); - @override set contentEditable(String? value) => super.noSuchMethod( Invocation.setter( @@ -616,7 +562,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set dir(String? value) => super.noSuchMethod( Invocation.setter( @@ -625,13 +570,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override bool get draggable => (super.noSuchMethod( Invocation.getter(#draggable), returnValue: false, ) as bool); - @override set draggable(bool? value) => super.noSuchMethod( Invocation.setter( @@ -640,13 +583,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override bool get hidden => (super.noSuchMethod( Invocation.getter(#hidden), returnValue: false, ) as bool); - @override set hidden(bool? value) => super.noSuchMethod( Invocation.setter( @@ -655,7 +596,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set inert(bool? value) => super.noSuchMethod( Invocation.setter( @@ -664,7 +604,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set inputMode(String? value) => super.noSuchMethod( Invocation.setter( @@ -673,7 +612,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set lang(String? value) => super.noSuchMethod( Invocation.setter( @@ -682,7 +620,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set spellcheck(bool? value) => super.noSuchMethod( Invocation.setter( @@ -691,7 +628,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.CssStyleDeclaration get style => (super.noSuchMethod( Invocation.getter(#style), @@ -700,7 +636,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#style), ), ) as _i2.CssStyleDeclaration); - @override set tabIndex(int? value) => super.noSuchMethod( Invocation.setter( @@ -709,7 +644,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set title(String? value) => super.noSuchMethod( Invocation.setter( @@ -718,7 +652,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set translate(bool? value) => super.noSuchMethod( Invocation.setter( @@ -727,16 +660,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override String get className => (super.noSuchMethod( Invocation.getter(#className), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#className), - ), + returnValue: '', ) as String); - @override set className(String? value) => super.noSuchMethod( Invocation.setter( @@ -745,28 +673,21 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override int get clientHeight => (super.noSuchMethod( Invocation.getter(#clientHeight), returnValue: 0, ) as int); - @override int get clientWidth => (super.noSuchMethod( Invocation.getter(#clientWidth), returnValue: 0, ) as int); - @override String get id => (super.noSuchMethod( Invocation.getter(#id), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#id), - ), + returnValue: '', ) as String); - @override set id(String? value) => super.noSuchMethod( Invocation.setter( @@ -775,7 +696,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override set slot(String? value) => super.noSuchMethod( Invocation.setter( @@ -784,16 +704,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override String get tagName => (super.noSuchMethod( Invocation.getter(#tagName), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#tagName), - ), + returnValue: '', ) as String); - @override _i2.ElementStream<_i2.Event> get onAbort => (super.noSuchMethod( Invocation.getter(#onAbort), @@ -802,7 +717,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onAbort), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onBeforeCopy => (super.noSuchMethod( Invocation.getter(#onBeforeCopy), @@ -811,7 +725,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onBeforeCopy), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onBeforeCut => (super.noSuchMethod( Invocation.getter(#onBeforeCut), @@ -820,7 +733,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onBeforeCut), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onBeforePaste => (super.noSuchMethod( Invocation.getter(#onBeforePaste), @@ -829,7 +741,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onBeforePaste), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onBlur => (super.noSuchMethod( Invocation.getter(#onBlur), @@ -838,7 +749,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onBlur), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onCanPlay => (super.noSuchMethod( Invocation.getter(#onCanPlay), @@ -847,7 +757,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onCanPlay), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onCanPlayThrough => (super.noSuchMethod( Invocation.getter(#onCanPlayThrough), @@ -856,7 +765,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onCanPlayThrough), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onChange => (super.noSuchMethod( Invocation.getter(#onChange), @@ -865,7 +773,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onChange), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.MouseEvent> get onClick => (super.noSuchMethod( Invocation.getter(#onClick), @@ -874,7 +781,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onClick), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onContextMenu => (super.noSuchMethod( Invocation.getter(#onContextMenu), @@ -883,7 +789,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onContextMenu), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.ClipboardEvent> get onCopy => (super.noSuchMethod( Invocation.getter(#onCopy), @@ -892,7 +797,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onCopy), ), ) as _i2.ElementStream<_i2.ClipboardEvent>); - @override _i2.ElementStream<_i2.ClipboardEvent> get onCut => (super.noSuchMethod( Invocation.getter(#onCut), @@ -901,7 +805,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onCut), ), ) as _i2.ElementStream<_i2.ClipboardEvent>); - @override _i2.ElementStream<_i2.Event> get onDoubleClick => (super.noSuchMethod( Invocation.getter(#onDoubleClick), @@ -910,7 +813,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDoubleClick), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.MouseEvent> get onDrag => (super.noSuchMethod( Invocation.getter(#onDrag), @@ -919,7 +821,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDrag), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onDragEnd => (super.noSuchMethod( Invocation.getter(#onDragEnd), @@ -928,7 +829,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDragEnd), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onDragEnter => (super.noSuchMethod( Invocation.getter(#onDragEnter), @@ -937,7 +837,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDragEnter), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onDragLeave => (super.noSuchMethod( Invocation.getter(#onDragLeave), @@ -946,7 +845,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDragLeave), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onDragOver => (super.noSuchMethod( Invocation.getter(#onDragOver), @@ -955,7 +853,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDragOver), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onDragStart => (super.noSuchMethod( Invocation.getter(#onDragStart), @@ -964,7 +861,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDragStart), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onDrop => (super.noSuchMethod( Invocation.getter(#onDrop), @@ -973,7 +869,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDrop), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.Event> get onDurationChange => (super.noSuchMethod( Invocation.getter(#onDurationChange), @@ -982,7 +877,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onDurationChange), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onEmptied => (super.noSuchMethod( Invocation.getter(#onEmptied), @@ -991,7 +885,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onEmptied), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onEnded => (super.noSuchMethod( Invocation.getter(#onEnded), @@ -1000,7 +893,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onEnded), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onError => (super.noSuchMethod( Invocation.getter(#onError), @@ -1009,7 +901,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onError), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onFocus => (super.noSuchMethod( Invocation.getter(#onFocus), @@ -1018,7 +909,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onFocus), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onInput => (super.noSuchMethod( Invocation.getter(#onInput), @@ -1027,7 +917,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onInput), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onInvalid => (super.noSuchMethod( Invocation.getter(#onInvalid), @@ -1036,7 +925,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onInvalid), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.KeyboardEvent> get onKeyDown => (super.noSuchMethod( Invocation.getter(#onKeyDown), @@ -1045,7 +933,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onKeyDown), ), ) as _i2.ElementStream<_i2.KeyboardEvent>); - @override _i2.ElementStream<_i2.KeyboardEvent> get onKeyPress => (super.noSuchMethod( Invocation.getter(#onKeyPress), @@ -1054,7 +941,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onKeyPress), ), ) as _i2.ElementStream<_i2.KeyboardEvent>); - @override _i2.ElementStream<_i2.KeyboardEvent> get onKeyUp => (super.noSuchMethod( Invocation.getter(#onKeyUp), @@ -1063,7 +949,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onKeyUp), ), ) as _i2.ElementStream<_i2.KeyboardEvent>); - @override _i2.ElementStream<_i2.Event> get onLoad => (super.noSuchMethod( Invocation.getter(#onLoad), @@ -1072,7 +957,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onLoad), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onLoadedData => (super.noSuchMethod( Invocation.getter(#onLoadedData), @@ -1081,7 +965,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onLoadedData), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onLoadedMetadata => (super.noSuchMethod( Invocation.getter(#onLoadedMetadata), @@ -1090,7 +973,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onLoadedMetadata), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.MouseEvent> get onMouseDown => (super.noSuchMethod( Invocation.getter(#onMouseDown), @@ -1099,7 +981,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onMouseDown), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onMouseEnter => (super.noSuchMethod( Invocation.getter(#onMouseEnter), @@ -1108,7 +989,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onMouseEnter), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onMouseLeave => (super.noSuchMethod( Invocation.getter(#onMouseLeave), @@ -1117,7 +997,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onMouseLeave), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onMouseMove => (super.noSuchMethod( Invocation.getter(#onMouseMove), @@ -1126,7 +1005,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onMouseMove), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onMouseOut => (super.noSuchMethod( Invocation.getter(#onMouseOut), @@ -1135,7 +1013,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onMouseOut), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onMouseOver => (super.noSuchMethod( Invocation.getter(#onMouseOver), @@ -1144,7 +1021,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onMouseOver), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.MouseEvent> get onMouseUp => (super.noSuchMethod( Invocation.getter(#onMouseUp), @@ -1153,7 +1029,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onMouseUp), ), ) as _i2.ElementStream<_i2.MouseEvent>); - @override _i2.ElementStream<_i2.WheelEvent> get onMouseWheel => (super.noSuchMethod( Invocation.getter(#onMouseWheel), @@ -1162,7 +1037,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onMouseWheel), ), ) as _i2.ElementStream<_i2.WheelEvent>); - @override _i2.ElementStream<_i2.ClipboardEvent> get onPaste => (super.noSuchMethod( Invocation.getter(#onPaste), @@ -1171,7 +1045,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onPaste), ), ) as _i2.ElementStream<_i2.ClipboardEvent>); - @override _i2.ElementStream<_i2.Event> get onPause => (super.noSuchMethod( Invocation.getter(#onPause), @@ -1180,7 +1053,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onPause), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onPlay => (super.noSuchMethod( Invocation.getter(#onPlay), @@ -1189,7 +1061,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onPlay), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onPlaying => (super.noSuchMethod( Invocation.getter(#onPlaying), @@ -1198,7 +1069,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onPlaying), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onRateChange => (super.noSuchMethod( Invocation.getter(#onRateChange), @@ -1207,7 +1077,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onRateChange), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onReset => (super.noSuchMethod( Invocation.getter(#onReset), @@ -1216,7 +1085,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onReset), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onResize => (super.noSuchMethod( Invocation.getter(#onResize), @@ -1225,7 +1093,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onResize), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onScroll => (super.noSuchMethod( Invocation.getter(#onScroll), @@ -1234,7 +1101,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onScroll), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onSearch => (super.noSuchMethod( Invocation.getter(#onSearch), @@ -1243,7 +1109,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onSearch), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onSeeked => (super.noSuchMethod( Invocation.getter(#onSeeked), @@ -1252,7 +1117,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onSeeked), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onSeeking => (super.noSuchMethod( Invocation.getter(#onSeeking), @@ -1261,7 +1125,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onSeeking), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onSelect => (super.noSuchMethod( Invocation.getter(#onSelect), @@ -1270,7 +1133,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onSelect), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onSelectStart => (super.noSuchMethod( Invocation.getter(#onSelectStart), @@ -1279,7 +1141,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onSelectStart), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onStalled => (super.noSuchMethod( Invocation.getter(#onStalled), @@ -1288,7 +1149,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onStalled), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onSubmit => (super.noSuchMethod( Invocation.getter(#onSubmit), @@ -1297,7 +1157,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onSubmit), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onSuspend => (super.noSuchMethod( Invocation.getter(#onSuspend), @@ -1306,7 +1165,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onSuspend), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onTimeUpdate => (super.noSuchMethod( Invocation.getter(#onTimeUpdate), @@ -1315,7 +1173,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onTimeUpdate), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.TouchEvent> get onTouchCancel => (super.noSuchMethod( Invocation.getter(#onTouchCancel), @@ -1324,7 +1181,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onTouchCancel), ), ) as _i2.ElementStream<_i2.TouchEvent>); - @override _i2.ElementStream<_i2.TouchEvent> get onTouchEnd => (super.noSuchMethod( Invocation.getter(#onTouchEnd), @@ -1333,7 +1189,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onTouchEnd), ), ) as _i2.ElementStream<_i2.TouchEvent>); - @override _i2.ElementStream<_i2.TouchEvent> get onTouchEnter => (super.noSuchMethod( Invocation.getter(#onTouchEnter), @@ -1342,7 +1197,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onTouchEnter), ), ) as _i2.ElementStream<_i2.TouchEvent>); - @override _i2.ElementStream<_i2.TouchEvent> get onTouchLeave => (super.noSuchMethod( Invocation.getter(#onTouchLeave), @@ -1351,7 +1205,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onTouchLeave), ), ) as _i2.ElementStream<_i2.TouchEvent>); - @override _i2.ElementStream<_i2.TouchEvent> get onTouchMove => (super.noSuchMethod( Invocation.getter(#onTouchMove), @@ -1360,7 +1213,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onTouchMove), ), ) as _i2.ElementStream<_i2.TouchEvent>); - @override _i2.ElementStream<_i2.TouchEvent> get onTouchStart => (super.noSuchMethod( Invocation.getter(#onTouchStart), @@ -1369,7 +1221,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onTouchStart), ), ) as _i2.ElementStream<_i2.TouchEvent>); - @override _i2.ElementStream<_i2.TransitionEvent> get onTransitionEnd => (super.noSuchMethod( @@ -1379,7 +1230,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onTransitionEnd), ), ) as _i2.ElementStream<_i2.TransitionEvent>); - @override _i2.ElementStream<_i2.Event> get onVolumeChange => (super.noSuchMethod( Invocation.getter(#onVolumeChange), @@ -1388,7 +1238,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onVolumeChange), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onWaiting => (super.noSuchMethod( Invocation.getter(#onWaiting), @@ -1397,7 +1246,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onWaiting), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onFullscreenChange => (super.noSuchMethod( Invocation.getter(#onFullscreenChange), @@ -1406,7 +1254,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onFullscreenChange), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.Event> get onFullscreenError => (super.noSuchMethod( Invocation.getter(#onFullscreenError), @@ -1415,7 +1262,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onFullscreenError), ), ) as _i2.ElementStream<_i2.Event>); - @override _i2.ElementStream<_i2.WheelEvent> get onWheel => (super.noSuchMethod( Invocation.getter(#onWheel), @@ -1424,13 +1270,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { Invocation.getter(#onWheel), ), ) as _i2.ElementStream<_i2.WheelEvent>); - @override List<_i2.Node> get nodes => (super.noSuchMethod( Invocation.getter(#nodes), returnValue: <_i2.Node>[], ) as List<_i2.Node>); - @override set nodes(Iterable<_i2.Node>? value) => super.noSuchMethod( Invocation.setter( @@ -1439,19 +1283,16 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override List<_i2.Node> get childNodes => (super.noSuchMethod( Invocation.getter(#childNodes), returnValue: <_i2.Node>[], ) as List<_i2.Node>); - @override int get nodeType => (super.noSuchMethod( Invocation.getter(#nodeType), returnValue: 0, ) as int); - @override set text(String? value) => super.noSuchMethod( Invocation.setter( @@ -1460,13 +1301,11 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override String? getAttribute(String? name) => (super.noSuchMethod(Invocation.method( #getAttribute, [name], )) as String?); - @override String? getAttributeNS( String? namespaceURI, @@ -1479,7 +1318,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { name, ], )) as String?); - @override bool hasAttribute(String? name) => (super.noSuchMethod( Invocation.method( @@ -1488,7 +1326,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: false, ) as bool); - @override bool hasAttributeNS( String? namespaceURI, @@ -1504,7 +1341,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: false, ) as bool); - @override void removeAttribute(String? name) => super.noSuchMethod( Invocation.method( @@ -1513,7 +1349,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void removeAttributeNS( String? namespaceURI, @@ -1529,7 +1364,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void setAttribute( String? name, @@ -1545,7 +1379,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void setAttributeNS( String? namespaceURI, @@ -1563,7 +1396,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.ElementList querySelectorAll( String? selectors) => @@ -1580,40 +1412,37 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.ElementList); - @override - _i7.Future<_i2.ScrollState> setApplyScroll(String? nativeScrollBehavior) => + _i6.Future<_i2.ScrollState> setApplyScroll(String? nativeScrollBehavior) => (super.noSuchMethod( Invocation.method( #setApplyScroll, [nativeScrollBehavior], ), - returnValue: _i7.Future<_i2.ScrollState>.value(_FakeScrollState_8( + returnValue: _i6.Future<_i2.ScrollState>.value(_FakeScrollState_8( this, Invocation.method( #setApplyScroll, [nativeScrollBehavior], ), )), - ) as _i7.Future<_i2.ScrollState>); - + ) as _i6.Future<_i2.ScrollState>); @override - _i7.Future<_i2.ScrollState> setDistributeScroll( + _i6.Future<_i2.ScrollState> setDistributeScroll( String? nativeScrollBehavior) => (super.noSuchMethod( Invocation.method( #setDistributeScroll, [nativeScrollBehavior], ), - returnValue: _i7.Future<_i2.ScrollState>.value(_FakeScrollState_8( + returnValue: _i6.Future<_i2.ScrollState>.value(_FakeScrollState_8( this, Invocation.method( #setDistributeScroll, [nativeScrollBehavior], ), )), - ) as _i7.Future<_i2.ScrollState>); - + ) as _i6.Future<_i2.ScrollState>); @override Map getNamespacedAttributes(String? namespace) => (super.noSuchMethod( @@ -1623,7 +1452,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: {}, ) as Map); - @override _i2.CssStyleDeclaration getComputedStyle([String? pseudoElement]) => (super.noSuchMethod( @@ -1639,7 +1467,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.CssStyleDeclaration); - @override void appendText(String? text) => super.noSuchMethod( Invocation.method( @@ -1648,7 +1475,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void appendHtml( String? text, { @@ -1666,7 +1492,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void attached() => super.noSuchMethod( Invocation.method( @@ -1675,7 +1500,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void detached() => super.noSuchMethod( Invocation.method( @@ -1684,7 +1508,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void enteredView() => super.noSuchMethod( Invocation.method( @@ -1693,7 +1516,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override List<_i3.Rectangle> getClientRects() => (super.noSuchMethod( Invocation.method( @@ -1702,7 +1524,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: <_i3.Rectangle>[], ) as List<_i3.Rectangle>); - @override void leftView() => super.noSuchMethod( Invocation.method( @@ -1711,7 +1532,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.Animation animate( Iterable>? frames, [ @@ -1736,7 +1556,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.Animation); - @override void attributeChanged( String? name, @@ -1754,7 +1573,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void scrollIntoView([_i2.ScrollAlignment? alignment]) => super.noSuchMethod( Invocation.method( @@ -1763,7 +1581,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void insertAdjacentText( String? where, @@ -1779,7 +1596,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void insertAdjacentHtml( String? where, @@ -1801,7 +1617,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.Element insertAdjacentElement( String? where, @@ -1826,7 +1641,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.Element); - @override bool matches(String? selectors) => (super.noSuchMethod( Invocation.method( @@ -1835,7 +1649,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: false, ) as bool); - @override bool matchesWithAncestors(String? selectors) => (super.noSuchMethod( Invocation.method( @@ -1844,7 +1657,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: false, ) as bool); - @override _i2.ShadowRoot createShadowRoot() => (super.noSuchMethod( Invocation.method( @@ -1859,7 +1671,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.ShadowRoot); - @override _i3.Point offsetTo(_i2.Element? parent) => (super.noSuchMethod( Invocation.method( @@ -1874,7 +1685,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i3.Point); - @override _i2.DocumentFragment createFragment( String? html, { @@ -1902,7 +1712,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.DocumentFragment); - @override void setInnerHtml( String? html, { @@ -1920,18 +1729,16 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override - _i7.Future requestFullscreen([Map? options]) => + _i6.Future requestFullscreen([Map? options]) => (super.noSuchMethod( Invocation.method( #requestFullscreen, [options], ), - returnValue: _i7.Future.value(), - returnValueForMissingStub: _i7.Future.value(), - ) as _i7.Future); - + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value(), + ) as _i6.Future); @override void blur() => super.noSuchMethod( Invocation.method( @@ -1940,7 +1747,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void click() => super.noSuchMethod( Invocation.method( @@ -1949,7 +1755,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void focus() => super.noSuchMethod( Invocation.method( @@ -1958,7 +1763,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.ShadowRoot attachShadow(Map? shadowRootInitDict) => (super.noSuchMethod( @@ -1974,14 +1778,12 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.ShadowRoot); - @override _i2.Element? closest(String? selectors) => (super.noSuchMethod(Invocation.method( #closest, [selectors], )) as _i2.Element?); - @override List<_i2.Animation> getAnimations() => (super.noSuchMethod( Invocation.method( @@ -1990,7 +1792,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: <_i2.Animation>[], ) as List<_i2.Animation>); - @override List getAttributeNames() => (super.noSuchMethod( Invocation.method( @@ -1999,7 +1800,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: [], ) as List); - @override _i3.Rectangle getBoundingClientRect() => (super.noSuchMethod( Invocation.method( @@ -2014,7 +1814,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i3.Rectangle); - @override List<_i2.Node> getDestinationInsertionPoints() => (super.noSuchMethod( Invocation.method( @@ -2023,7 +1822,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: <_i2.Node>[], ) as List<_i2.Node>); - @override List<_i2.Node> getElementsByClassName(String? classNames) => (super.noSuchMethod( @@ -2033,7 +1831,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: <_i2.Node>[], ) as List<_i2.Node>); - @override bool hasPointerCapture(int? pointerId) => (super.noSuchMethod( Invocation.method( @@ -2042,7 +1839,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: false, ) as bool); - @override void releasePointerCapture(int? pointerId) => super.noSuchMethod( Invocation.method( @@ -2051,7 +1847,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void requestPointerLock() => super.noSuchMethod( Invocation.method( @@ -2060,7 +1855,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void scroll([ dynamic options_OR_x, @@ -2076,7 +1870,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void scrollBy([ dynamic options_OR_x, @@ -2092,7 +1885,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void scrollIntoViewIfNeeded([bool? centerIfNeeded]) => super.noSuchMethod( Invocation.method( @@ -2101,7 +1893,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void scrollTo([ dynamic options_OR_x, @@ -2117,7 +1908,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void setPointerCapture(int? pointerId) => super.noSuchMethod( Invocation.method( @@ -2126,7 +1916,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void after(Object? nodes) => super.noSuchMethod( Invocation.method( @@ -2135,7 +1924,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void before(Object? nodes) => super.noSuchMethod( Invocation.method( @@ -2144,14 +1932,12 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.Element? querySelector(String? selectors) => (super.noSuchMethod(Invocation.method( #querySelector, [selectors], )) as _i2.Element?); - @override void remove() => super.noSuchMethod( Invocation.method( @@ -2160,7 +1946,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.Node replaceWith(_i2.Node? otherNode) => (super.noSuchMethod( Invocation.method( @@ -2175,7 +1960,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.Node); - @override void insertAllBefore( Iterable<_i2.Node>? newNodes, @@ -2191,7 +1975,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override _i2.Node append(_i2.Node? node) => (super.noSuchMethod( Invocation.method( @@ -2206,7 +1989,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.Node); - @override _i2.Node clone(bool? deep) => (super.noSuchMethod( Invocation.method( @@ -2221,7 +2003,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.Node); - @override bool contains(_i2.Node? other) => (super.noSuchMethod( Invocation.method( @@ -2230,7 +2011,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: false, ) as bool); - @override _i2.Node getRootNode([Map? options]) => (super.noSuchMethod( Invocation.method( @@ -2245,7 +2025,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.Node); - @override bool hasChildNodes() => (super.noSuchMethod( Invocation.method( @@ -2254,7 +2033,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValue: false, ) as bool); - @override _i2.Node insertBefore( _i2.Node? node, @@ -2279,7 +2057,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), ), ) as _i2.Node); - @override void addEventListener( String? type, @@ -2297,7 +2074,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override void removeEventListener( String? type, @@ -2315,7 +2091,6 @@ class MockIFrameElement extends _i1.Mock implements _i2.IFrameElement { ), returnValueForMissingStub: null, ); - @override bool dispatchEvent(_i2.Event? event) => (super.noSuchMethod( Invocation.method( @@ -2342,19 +2117,16 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { Invocation.getter(#widget), ), ) as _i4.Widget); - @override bool get mounted => (super.noSuchMethod( Invocation.getter(#mounted), returnValue: false, ) as bool); - @override bool get debugDoingBuild => (super.noSuchMethod( Invocation.getter(#debugDoingBuild), returnValue: false, ) as bool); - @override _i4.InheritedWidget dependOnInheritedElement( _i4.InheritedElement? ancestor, { @@ -2375,9 +2147,8 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { ), ), ) as _i4.InheritedWidget); - @override - void visitAncestorElements(_i4.ConditionalElementVisitor? visitor) => + void visitAncestorElements(bool Function(_i4.Element)? visitor) => super.noSuchMethod( Invocation.method( #visitAncestorElements, @@ -2385,7 +2156,6 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { ), returnValueForMissingStub: null, ); - @override void visitChildElements(_i4.ElementVisitor? visitor) => super.noSuchMethod( Invocation.method( @@ -2394,9 +2164,8 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { ), returnValueForMissingStub: null, ); - @override - void dispatchNotification(_i8.Notification? notification) => + void dispatchNotification(_i7.Notification? notification) => super.noSuchMethod( Invocation.method( #dispatchNotification, @@ -2404,7 +2173,6 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { ), returnValueForMissingStub: null, ); - @override _i5.DiagnosticsNode describeElement( String? name, { @@ -2425,7 +2193,6 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { ), ), ) as _i5.DiagnosticsNode); - @override _i5.DiagnosticsNode describeWidget( String? name, { @@ -2446,7 +2213,6 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { ), ), ) as _i5.DiagnosticsNode); - @override List<_i5.DiagnosticsNode> describeMissingAncestor( {required Type? expectedAncestorType}) => @@ -2458,7 +2224,6 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { ), returnValue: <_i5.DiagnosticsNode>[], ) as List<_i5.DiagnosticsNode>); - @override _i5.DiagnosticsNode describeOwnershipChain(String? name) => (super.noSuchMethod( @@ -2479,7 +2244,7 @@ class MockBuildContext extends _i1.Mock implements _i4.BuildContext { /// A class which mocks [CreationParams]. /// /// See the documentation for Mockito's code generation for more information. -class MockCreationParams extends _i1.Mock implements _i9.CreationParams { +class MockCreationParams extends _i1.Mock implements _i8.CreationParams { MockCreationParams() { _i1.throwOnMissingStub(this); } @@ -2489,33 +2254,31 @@ class MockCreationParams extends _i1.Mock implements _i9.CreationParams { Invocation.getter(#javascriptChannelNames), returnValue: {}, ) as Set); - @override - _i9.AutoMediaPlaybackPolicy get autoMediaPlaybackPolicy => + _i8.AutoMediaPlaybackPolicy get autoMediaPlaybackPolicy => (super.noSuchMethod( Invocation.getter(#autoMediaPlaybackPolicy), returnValue: - _i9.AutoMediaPlaybackPolicy.require_user_action_for_all_media_types, - ) as _i9.AutoMediaPlaybackPolicy); - + _i8.AutoMediaPlaybackPolicy.require_user_action_for_all_media_types, + ) as _i8.AutoMediaPlaybackPolicy); @override - List<_i9.WebViewCookie> get cookies => (super.noSuchMethod( + List<_i8.WebViewCookie> get cookies => (super.noSuchMethod( Invocation.getter(#cookies), - returnValue: <_i9.WebViewCookie>[], - ) as List<_i9.WebViewCookie>); + returnValue: <_i8.WebViewCookie>[], + ) as List<_i8.WebViewCookie>); } /// A class which mocks [WebViewPlatformCallbacksHandler]. /// /// See the documentation for Mockito's code generation for more information. class MockWebViewPlatformCallbacksHandler extends _i1.Mock - implements _i10.WebViewPlatformCallbacksHandler { + implements _i9.WebViewPlatformCallbacksHandler { MockWebViewPlatformCallbacksHandler() { _i1.throwOnMissingStub(this); } @override - _i7.FutureOr onNavigationRequest({ + _i6.FutureOr onNavigationRequest({ required String? url, required bool? isForMainFrame, }) => @@ -2528,9 +2291,8 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock #isForMainFrame: isForMainFrame, }, ), - returnValue: _i7.Future.value(false), - ) as _i7.FutureOr); - + returnValue: _i6.Future.value(false), + ) as _i6.FutureOr); @override void onPageStarted(String? url) => super.noSuchMethod( Invocation.method( @@ -2539,7 +2301,6 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void onPageFinished(String? url) => super.noSuchMethod( Invocation.method( @@ -2548,7 +2309,6 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void onProgress(int? progress) => super.noSuchMethod( Invocation.method( @@ -2557,9 +2317,8 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); - @override - void onWebResourceError(_i9.WebResourceError? error) => super.noSuchMethod( + void onWebResourceError(_i8.WebResourceError? error) => super.noSuchMethod( Invocation.method( #onWebResourceError, [error], @@ -2572,13 +2331,13 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock /// /// See the documentation for Mockito's code generation for more information. class MockHttpRequestFactory extends _i1.Mock - implements _i11.HttpRequestFactory { + implements _i10.HttpRequestFactory { MockHttpRequestFactory() { _i1.throwOnMissingStub(this); } @override - _i7.Future<_i2.HttpRequest> request( + _i6.Future<_i2.HttpRequest> request( String? url, { String? method, bool? withCredentials, @@ -2602,7 +2361,7 @@ class MockHttpRequestFactory extends _i1.Mock #onProgress: onProgress, }, ), - returnValue: _i7.Future<_i2.HttpRequest>.value(_FakeHttpRequest_17( + returnValue: _i6.Future<_i2.HttpRequest>.value(_FakeHttpRequest_17( this, Invocation.method( #request, @@ -2618,7 +2377,7 @@ class MockHttpRequestFactory extends _i1.Mock }, ), )), - ) as _i7.Future<_i2.HttpRequest>); + ) as _i6.Future<_i2.HttpRequest>); } /// A class which mocks [HttpRequest]. @@ -2634,22 +2393,16 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { Invocation.getter(#responseHeaders), returnValue: {}, ) as Map); - @override int get readyState => (super.noSuchMethod( Invocation.getter(#readyState), returnValue: 0, ) as int); - @override String get responseType => (super.noSuchMethod( Invocation.getter(#responseType), - returnValue: _i6.dummyValue( - this, - Invocation.getter(#responseType), - ), + returnValue: '', ) as String); - @override set responseType(String? value) => super.noSuchMethod( Invocation.setter( @@ -2658,7 +2411,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override set timeout(int? value) => super.noSuchMethod( Invocation.setter( @@ -2667,7 +2419,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override _i2.HttpRequestUpload get upload => (super.noSuchMethod( Invocation.getter(#upload), @@ -2676,7 +2427,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { Invocation.getter(#upload), ), ) as _i2.HttpRequestUpload); - @override set withCredentials(bool? value) => super.noSuchMethod( Invocation.setter( @@ -2685,55 +2435,46 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override - _i7.Stream<_i2.Event> get onReadyStateChange => (super.noSuchMethod( + _i6.Stream<_i2.Event> get onReadyStateChange => (super.noSuchMethod( Invocation.getter(#onReadyStateChange), - returnValue: _i7.Stream<_i2.Event>.empty(), - ) as _i7.Stream<_i2.Event>); - + returnValue: _i6.Stream<_i2.Event>.empty(), + ) as _i6.Stream<_i2.Event>); @override - _i7.Stream<_i2.ProgressEvent> get onAbort => (super.noSuchMethod( + _i6.Stream<_i2.ProgressEvent> get onAbort => (super.noSuchMethod( Invocation.getter(#onAbort), - returnValue: _i7.Stream<_i2.ProgressEvent>.empty(), - ) as _i7.Stream<_i2.ProgressEvent>); - + returnValue: _i6.Stream<_i2.ProgressEvent>.empty(), + ) as _i6.Stream<_i2.ProgressEvent>); @override - _i7.Stream<_i2.ProgressEvent> get onError => (super.noSuchMethod( + _i6.Stream<_i2.ProgressEvent> get onError => (super.noSuchMethod( Invocation.getter(#onError), - returnValue: _i7.Stream<_i2.ProgressEvent>.empty(), - ) as _i7.Stream<_i2.ProgressEvent>); - + returnValue: _i6.Stream<_i2.ProgressEvent>.empty(), + ) as _i6.Stream<_i2.ProgressEvent>); @override - _i7.Stream<_i2.ProgressEvent> get onLoad => (super.noSuchMethod( + _i6.Stream<_i2.ProgressEvent> get onLoad => (super.noSuchMethod( Invocation.getter(#onLoad), - returnValue: _i7.Stream<_i2.ProgressEvent>.empty(), - ) as _i7.Stream<_i2.ProgressEvent>); - + returnValue: _i6.Stream<_i2.ProgressEvent>.empty(), + ) as _i6.Stream<_i2.ProgressEvent>); @override - _i7.Stream<_i2.ProgressEvent> get onLoadEnd => (super.noSuchMethod( + _i6.Stream<_i2.ProgressEvent> get onLoadEnd => (super.noSuchMethod( Invocation.getter(#onLoadEnd), - returnValue: _i7.Stream<_i2.ProgressEvent>.empty(), - ) as _i7.Stream<_i2.ProgressEvent>); - + returnValue: _i6.Stream<_i2.ProgressEvent>.empty(), + ) as _i6.Stream<_i2.ProgressEvent>); @override - _i7.Stream<_i2.ProgressEvent> get onLoadStart => (super.noSuchMethod( + _i6.Stream<_i2.ProgressEvent> get onLoadStart => (super.noSuchMethod( Invocation.getter(#onLoadStart), - returnValue: _i7.Stream<_i2.ProgressEvent>.empty(), - ) as _i7.Stream<_i2.ProgressEvent>); - + returnValue: _i6.Stream<_i2.ProgressEvent>.empty(), + ) as _i6.Stream<_i2.ProgressEvent>); @override - _i7.Stream<_i2.ProgressEvent> get onProgress => (super.noSuchMethod( + _i6.Stream<_i2.ProgressEvent> get onProgress => (super.noSuchMethod( Invocation.getter(#onProgress), - returnValue: _i7.Stream<_i2.ProgressEvent>.empty(), - ) as _i7.Stream<_i2.ProgressEvent>); - + returnValue: _i6.Stream<_i2.ProgressEvent>.empty(), + ) as _i6.Stream<_i2.ProgressEvent>); @override - _i7.Stream<_i2.ProgressEvent> get onTimeout => (super.noSuchMethod( + _i6.Stream<_i2.ProgressEvent> get onTimeout => (super.noSuchMethod( Invocation.getter(#onTimeout), - returnValue: _i7.Stream<_i2.ProgressEvent>.empty(), - ) as _i7.Stream<_i2.ProgressEvent>); - + returnValue: _i6.Stream<_i2.ProgressEvent>.empty(), + ) as _i6.Stream<_i2.ProgressEvent>); @override _i2.Events get on => (super.noSuchMethod( Invocation.getter(#on), @@ -2742,7 +2483,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { Invocation.getter(#on), ), ) as _i2.Events); - @override void open( String? method, @@ -2766,7 +2506,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void abort() => super.noSuchMethod( Invocation.method( @@ -2775,29 +2514,20 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override String getAllResponseHeaders() => (super.noSuchMethod( Invocation.method( #getAllResponseHeaders, [], ), - returnValue: _i6.dummyValue( - this, - Invocation.method( - #getAllResponseHeaders, - [], - ), - ), + returnValue: '', ) as String); - @override String? getResponseHeader(String? name) => (super.noSuchMethod(Invocation.method( #getResponseHeader, [name], )) as String?); - @override void overrideMimeType(String? mime) => super.noSuchMethod( Invocation.method( @@ -2806,7 +2536,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void send([dynamic body_OR_data]) => super.noSuchMethod( Invocation.method( @@ -2815,7 +2544,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void setRequestHeader( String? name, @@ -2831,7 +2559,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void addEventListener( String? type, @@ -2849,7 +2576,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void removeEventListener( String? type, @@ -2867,7 +2593,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override bool dispatchEvent(_i2.Event? event) => (super.noSuchMethod( Invocation.method( diff --git a/packages/webview_flutter/webview_flutter_web/test/web_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_web/test/web_webview_controller_test.mocks.dart index 07813ca34bde..6f7a2c879532 100644 --- a/packages/webview_flutter/webview_flutter_web/test/web_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_web/test/web_webview_controller_test.mocks.dart @@ -1,21 +1,18 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.0 from annotations // in webview_flutter_web/test/web_webview_controller_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'dart:async' as _i4; +import 'dart:async' as _i3; import 'dart:html' as _i2; import 'package:mockito/mockito.dart' as _i1; -import 'package:mockito/src/dummies.dart' as _i3; -import 'package:webview_flutter_web/src/http_request_factory.dart' as _i5; +import 'package:webview_flutter_web/src/http_request_factory.dart' as _i4; // ignore_for_file: type=lint // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -64,27 +61,18 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { returnValue: {}, returnValueForMissingStub: {}, ) as Map); - @override int get readyState => (super.noSuchMethod( Invocation.getter(#readyState), returnValue: 0, returnValueForMissingStub: 0, ) as int); - @override String get responseType => (super.noSuchMethod( Invocation.getter(#responseType), - returnValue: _i3.dummyValue( - this, - Invocation.getter(#responseType), - ), - returnValueForMissingStub: _i3.dummyValue( - this, - Invocation.getter(#responseType), - ), + returnValue: '', + returnValueForMissingStub: '', ) as String); - @override set responseType(String? value) => super.noSuchMethod( Invocation.setter( @@ -93,7 +81,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override set timeout(int? value) => super.noSuchMethod( Invocation.setter( @@ -102,7 +89,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override _i2.HttpRequestUpload get upload => (super.noSuchMethod( Invocation.getter(#upload), @@ -115,7 +101,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { Invocation.getter(#upload), ), ) as _i2.HttpRequestUpload); - @override set withCredentials(bool? value) => super.noSuchMethod( Invocation.setter( @@ -124,63 +109,54 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override - _i4.Stream<_i2.Event> get onReadyStateChange => (super.noSuchMethod( + _i3.Stream<_i2.Event> get onReadyStateChange => (super.noSuchMethod( Invocation.getter(#onReadyStateChange), - returnValue: _i4.Stream<_i2.Event>.empty(), - returnValueForMissingStub: _i4.Stream<_i2.Event>.empty(), - ) as _i4.Stream<_i2.Event>); - + returnValue: _i3.Stream<_i2.Event>.empty(), + returnValueForMissingStub: _i3.Stream<_i2.Event>.empty(), + ) as _i3.Stream<_i2.Event>); @override - _i4.Stream<_i2.ProgressEvent> get onAbort => (super.noSuchMethod( + _i3.Stream<_i2.ProgressEvent> get onAbort => (super.noSuchMethod( Invocation.getter(#onAbort), - returnValue: _i4.Stream<_i2.ProgressEvent>.empty(), - returnValueForMissingStub: _i4.Stream<_i2.ProgressEvent>.empty(), - ) as _i4.Stream<_i2.ProgressEvent>); - + returnValue: _i3.Stream<_i2.ProgressEvent>.empty(), + returnValueForMissingStub: _i3.Stream<_i2.ProgressEvent>.empty(), + ) as _i3.Stream<_i2.ProgressEvent>); @override - _i4.Stream<_i2.ProgressEvent> get onError => (super.noSuchMethod( + _i3.Stream<_i2.ProgressEvent> get onError => (super.noSuchMethod( Invocation.getter(#onError), - returnValue: _i4.Stream<_i2.ProgressEvent>.empty(), - returnValueForMissingStub: _i4.Stream<_i2.ProgressEvent>.empty(), - ) as _i4.Stream<_i2.ProgressEvent>); - + returnValue: _i3.Stream<_i2.ProgressEvent>.empty(), + returnValueForMissingStub: _i3.Stream<_i2.ProgressEvent>.empty(), + ) as _i3.Stream<_i2.ProgressEvent>); @override - _i4.Stream<_i2.ProgressEvent> get onLoad => (super.noSuchMethod( + _i3.Stream<_i2.ProgressEvent> get onLoad => (super.noSuchMethod( Invocation.getter(#onLoad), - returnValue: _i4.Stream<_i2.ProgressEvent>.empty(), - returnValueForMissingStub: _i4.Stream<_i2.ProgressEvent>.empty(), - ) as _i4.Stream<_i2.ProgressEvent>); - + returnValue: _i3.Stream<_i2.ProgressEvent>.empty(), + returnValueForMissingStub: _i3.Stream<_i2.ProgressEvent>.empty(), + ) as _i3.Stream<_i2.ProgressEvent>); @override - _i4.Stream<_i2.ProgressEvent> get onLoadEnd => (super.noSuchMethod( + _i3.Stream<_i2.ProgressEvent> get onLoadEnd => (super.noSuchMethod( Invocation.getter(#onLoadEnd), - returnValue: _i4.Stream<_i2.ProgressEvent>.empty(), - returnValueForMissingStub: _i4.Stream<_i2.ProgressEvent>.empty(), - ) as _i4.Stream<_i2.ProgressEvent>); - + returnValue: _i3.Stream<_i2.ProgressEvent>.empty(), + returnValueForMissingStub: _i3.Stream<_i2.ProgressEvent>.empty(), + ) as _i3.Stream<_i2.ProgressEvent>); @override - _i4.Stream<_i2.ProgressEvent> get onLoadStart => (super.noSuchMethod( + _i3.Stream<_i2.ProgressEvent> get onLoadStart => (super.noSuchMethod( Invocation.getter(#onLoadStart), - returnValue: _i4.Stream<_i2.ProgressEvent>.empty(), - returnValueForMissingStub: _i4.Stream<_i2.ProgressEvent>.empty(), - ) as _i4.Stream<_i2.ProgressEvent>); - + returnValue: _i3.Stream<_i2.ProgressEvent>.empty(), + returnValueForMissingStub: _i3.Stream<_i2.ProgressEvent>.empty(), + ) as _i3.Stream<_i2.ProgressEvent>); @override - _i4.Stream<_i2.ProgressEvent> get onProgress => (super.noSuchMethod( + _i3.Stream<_i2.ProgressEvent> get onProgress => (super.noSuchMethod( Invocation.getter(#onProgress), - returnValue: _i4.Stream<_i2.ProgressEvent>.empty(), - returnValueForMissingStub: _i4.Stream<_i2.ProgressEvent>.empty(), - ) as _i4.Stream<_i2.ProgressEvent>); - + returnValue: _i3.Stream<_i2.ProgressEvent>.empty(), + returnValueForMissingStub: _i3.Stream<_i2.ProgressEvent>.empty(), + ) as _i3.Stream<_i2.ProgressEvent>); @override - _i4.Stream<_i2.ProgressEvent> get onTimeout => (super.noSuchMethod( + _i3.Stream<_i2.ProgressEvent> get onTimeout => (super.noSuchMethod( Invocation.getter(#onTimeout), - returnValue: _i4.Stream<_i2.ProgressEvent>.empty(), - returnValueForMissingStub: _i4.Stream<_i2.ProgressEvent>.empty(), - ) as _i4.Stream<_i2.ProgressEvent>); - + returnValue: _i3.Stream<_i2.ProgressEvent>.empty(), + returnValueForMissingStub: _i3.Stream<_i2.ProgressEvent>.empty(), + ) as _i3.Stream<_i2.ProgressEvent>); @override _i2.Events get on => (super.noSuchMethod( Invocation.getter(#on), @@ -193,7 +169,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { Invocation.getter(#on), ), ) as _i2.Events); - @override void open( String? method, @@ -217,7 +192,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void abort() => super.noSuchMethod( Invocation.method( @@ -226,29 +200,15 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override String getAllResponseHeaders() => (super.noSuchMethod( Invocation.method( #getAllResponseHeaders, [], ), - returnValue: _i3.dummyValue( - this, - Invocation.method( - #getAllResponseHeaders, - [], - ), - ), - returnValueForMissingStub: _i3.dummyValue( - this, - Invocation.method( - #getAllResponseHeaders, - [], - ), - ), + returnValue: '', + returnValueForMissingStub: '', ) as String); - @override String? getResponseHeader(String? name) => (super.noSuchMethod( Invocation.method( @@ -257,7 +217,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ) as String?); - @override void overrideMimeType(String? mime) => super.noSuchMethod( Invocation.method( @@ -266,7 +225,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void send([dynamic body_OR_data]) => super.noSuchMethod( Invocation.method( @@ -275,7 +233,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void setRequestHeader( String? name, @@ -291,7 +248,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void addEventListener( String? type, @@ -309,7 +265,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override void removeEventListener( String? type, @@ -327,7 +282,6 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { ), returnValueForMissingStub: null, ); - @override bool dispatchEvent(_i2.Event? event) => (super.noSuchMethod( Invocation.method( @@ -343,9 +297,9 @@ class MockHttpRequest extends _i1.Mock implements _i2.HttpRequest { /// /// See the documentation for Mockito's code generation for more information. class MockHttpRequestFactory extends _i1.Mock - implements _i5.HttpRequestFactory { + implements _i4.HttpRequestFactory { @override - _i4.Future<_i2.HttpRequest> request( + _i3.Future<_i2.HttpRequest> request( String? url, { String? method, bool? withCredentials, @@ -369,7 +323,7 @@ class MockHttpRequestFactory extends _i1.Mock #onProgress: onProgress, }, ), - returnValue: _i4.Future<_i2.HttpRequest>.value(_FakeHttpRequest_2( + returnValue: _i3.Future<_i2.HttpRequest>.value(_FakeHttpRequest_2( this, Invocation.method( #request, @@ -386,7 +340,7 @@ class MockHttpRequestFactory extends _i1.Mock ), )), returnValueForMissingStub: - _i4.Future<_i2.HttpRequest>.value(_FakeHttpRequest_2( + _i3.Future<_i2.HttpRequest>.value(_FakeHttpRequest_2( this, Invocation.method( #request, @@ -402,5 +356,5 @@ class MockHttpRequestFactory extends _i1.Mock }, ), )), - ) as _i4.Future<_i2.HttpRequest>); + ) as _i3.Future<_i2.HttpRequest>); } diff --git a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml index 659040463230..32b8aa3f94f3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/example/pubspec.yaml @@ -10,7 +10,7 @@ dependencies: flutter: sdk: flutter path_provider: ^2.0.6 - webview_flutter_platform_interface: ^2.7.0 + webview_flutter_platform_interface: ^2.6.0 webview_flutter_wkwebview: # When depending on this package from a real application you should use: # webview_flutter: ^x.y.z @@ -32,3 +32,8 @@ flutter: - assets/sample_video.mp4 - assets/www/index.html - assets/www/styles/style.css + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {webview_flutter_platform_interface: {path: ../../../webview_flutter/webview_flutter_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml index a7e58858c08e..ae8b7837963b 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml +++ b/packages/webview_flutter/webview_flutter_wkwebview/pubspec.yaml @@ -26,10 +26,15 @@ dev_dependencies: build_runner: ^2.1.5 flutter_test: sdk: flutter - mockito: 5.4.3 + mockito: 5.4.1 pigeon: ^13.0.0 topics: - html - webview - webview-flutter + +# FOR TESTING AND INITIAL REVIEW ONLY. DO NOT MERGE. +# See https://github.com/flutter/flutter/wiki/Contributing-to-Plugins-and-Packages#changing-federated-plugins +dependency_overrides: + {webview_flutter_platform_interface: {path: ../../webview_flutter/webview_flutter_platform_interface}} diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart index 40bfe28fc234..5d0eede3b0ec 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_wkwebview/test/legacy/web_kit_cookie_manager_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -14,8 +16,6 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -63,7 +63,6 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i2.WKHttpCookieStore copy() => (super.noSuchMethod( Invocation.method( @@ -78,7 +77,6 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { ), ), ) as _i2.WKHttpCookieStore); - @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -97,7 +95,6 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future removeObserver( _i4.NSObject? observer, { @@ -132,7 +129,6 @@ class MockWKWebsiteDataStore extends _i1.Mock Invocation.getter(#httpCookieStore), ), ) as _i2.WKHttpCookieStore); - @override _i3.Future removeDataOfTypes( Set<_i2.WKWebsiteDataType>? dataTypes, @@ -148,7 +144,6 @@ class MockWKWebsiteDataStore extends _i1.Mock ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i2.WKWebsiteDataStore copy() => (super.noSuchMethod( Invocation.method( @@ -163,7 +158,6 @@ class MockWKWebsiteDataStore extends _i1.Mock ), ), ) as _i2.WKWebsiteDataStore); - @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -182,7 +176,6 @@ class MockWKWebsiteDataStore extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future removeObserver( _i4.NSObject? observer, { diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart index fb02072b2dac..8de47910fef3 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_wkwebview/test/legacy/web_kit_webview_widget_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i5; import 'dart:math' as _i2; @@ -25,8 +27,6 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i4; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -174,7 +174,6 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { ), )), ) as _i5.Future<_i2.Point>); - @override _i5.Future scrollBy(_i2.Point? offset) => (super.noSuchMethod( Invocation.method( @@ -184,7 +183,6 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setContentOffset(_i2.Point? offset) => (super.noSuchMethod( @@ -195,7 +193,6 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i3.UIScrollView copy() => (super.noSuchMethod( Invocation.method( @@ -210,7 +207,6 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { ), ), ) as _i3.UIScrollView); - @override _i5.Future setBackgroundColor(_i6.Color? color) => (super.noSuchMethod( Invocation.method( @@ -220,7 +216,6 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setOpaque(bool? opaque) => (super.noSuchMethod( Invocation.method( @@ -230,7 +225,6 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -249,7 +243,6 @@ class MockUIScrollView extends _i1.Mock implements _i3.UIScrollView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -290,7 +283,6 @@ class MockWKNavigationDelegate extends _i1.Mock ), ), ) as _i4.WKNavigationDelegate); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -309,7 +301,6 @@ class MockWKNavigationDelegate extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -344,7 +335,6 @@ class MockWKPreferences extends _i1.Mock implements _i4.WKPreferences { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i4.WKPreferences copy() => (super.noSuchMethod( Invocation.method( @@ -359,7 +349,6 @@ class MockWKPreferences extends _i1.Mock implements _i4.WKPreferences { ), ), ) as _i4.WKPreferences); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -378,7 +367,6 @@ class MockWKPreferences extends _i1.Mock implements _i4.WKPreferences { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -419,7 +407,6 @@ class MockWKScriptMessageHandler extends _i1.Mock _i4.WKUserContentController, _i4.WKScriptMessage, )); - @override _i4.WKScriptMessageHandler copy() => (super.noSuchMethod( Invocation.method( @@ -434,7 +421,6 @@ class MockWKScriptMessageHandler extends _i1.Mock ), ), ) as _i4.WKScriptMessageHandler); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -453,7 +439,6 @@ class MockWKScriptMessageHandler extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -487,7 +472,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { Invocation.getter(#configuration), ), ) as _i4.WKWebViewConfiguration); - @override _i3.UIScrollView get scrollView => (super.noSuchMethod( Invocation.getter(#scrollView), @@ -496,7 +480,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { Invocation.getter(#scrollView), ), ) as _i3.UIScrollView); - @override _i5.Future setUIDelegate(_i4.WKUIDelegate? delegate) => (super.noSuchMethod( @@ -507,7 +490,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setNavigationDelegate(_i4.WKNavigationDelegate? delegate) => (super.noSuchMethod( @@ -518,7 +500,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future getUrl() => (super.noSuchMethod( Invocation.method( @@ -527,7 +508,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future getEstimatedProgress() => (super.noSuchMethod( Invocation.method( @@ -536,7 +516,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(0.0), ) as _i5.Future); - @override _i5.Future loadRequest(_i7.NSUrlRequest? request) => (super.noSuchMethod( @@ -547,7 +526,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future loadHtmlString( String? string, { @@ -562,7 +540,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future loadFileUrl( String? url, { @@ -577,7 +554,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future loadFlutterAsset(String? key) => (super.noSuchMethod( Invocation.method( @@ -587,7 +563,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future canGoBack() => (super.noSuchMethod( Invocation.method( @@ -596,7 +571,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(false), ) as _i5.Future); - @override _i5.Future canGoForward() => (super.noSuchMethod( Invocation.method( @@ -605,7 +579,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(false), ) as _i5.Future); - @override _i5.Future goBack() => (super.noSuchMethod( Invocation.method( @@ -615,7 +588,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future goForward() => (super.noSuchMethod( Invocation.method( @@ -625,7 +597,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future reload() => (super.noSuchMethod( Invocation.method( @@ -635,7 +606,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future getTitle() => (super.noSuchMethod( Invocation.method( @@ -644,7 +614,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( @@ -655,7 +624,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( Invocation.method( @@ -665,7 +633,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( @@ -675,7 +642,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setInspectable(bool? inspectable) => (super.noSuchMethod( Invocation.method( @@ -685,7 +651,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future getCustomUserAgent() => (super.noSuchMethod( Invocation.method( @@ -694,7 +659,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), returnValue: _i5.Future.value(), ) as _i5.Future); - @override _i4.WKWebView copy() => (super.noSuchMethod( Invocation.method( @@ -709,7 +673,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { ), ), ) as _i4.WKWebView); - @override _i5.Future setBackgroundColor(_i6.Color? color) => (super.noSuchMethod( Invocation.method( @@ -719,7 +682,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setOpaque(bool? opaque) => (super.noSuchMethod( Invocation.method( @@ -729,7 +691,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -748,7 +709,6 @@ class MockWKWebView extends _i1.Mock implements _i4.WKWebView { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -783,7 +743,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#userContentController), ), ) as _i4.WKUserContentController); - @override _i4.WKPreferences get preferences => (super.noSuchMethod( Invocation.getter(#preferences), @@ -792,7 +751,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#preferences), ), ) as _i4.WKPreferences); - @override _i4.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( Invocation.getter(#websiteDataStore), @@ -801,7 +759,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#websiteDataStore), ), ) as _i4.WKWebsiteDataStore); - @override _i5.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( @@ -812,7 +769,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( @@ -823,7 +779,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future setMediaTypesRequiringUserActionForPlayback( Set<_i4.WKAudiovisualMediaType>? types) => @@ -835,7 +790,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i4.WKWebViewConfiguration copy() => (super.noSuchMethod( Invocation.method( @@ -850,7 +804,6 @@ class MockWKWebViewConfiguration extends _i1.Mock ), ), ) as _i4.WKWebViewConfiguration); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -869,7 +822,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -904,7 +856,6 @@ class MockWKWebsiteDataStore extends _i1.Mock Invocation.getter(#httpCookieStore), ), ) as _i4.WKHttpCookieStore); - @override _i5.Future removeDataOfTypes( Set<_i4.WKWebsiteDataType>? dataTypes, @@ -920,7 +871,6 @@ class MockWKWebsiteDataStore extends _i1.Mock ), returnValue: _i5.Future.value(false), ) as _i5.Future); - @override _i4.WKWebsiteDataStore copy() => (super.noSuchMethod( Invocation.method( @@ -935,7 +885,6 @@ class MockWKWebsiteDataStore extends _i1.Mock ), ), ) as _i4.WKWebsiteDataStore); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -954,7 +903,6 @@ class MockWKWebsiteDataStore extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -994,7 +942,6 @@ class MockWKUIDelegate extends _i1.Mock implements _i4.WKUIDelegate { ), ), ) as _i4.WKUIDelegate); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -1013,7 +960,6 @@ class MockWKUIDelegate extends _i1.Mock implements _i4.WKUIDelegate { returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -1056,7 +1002,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( @@ -1067,7 +1012,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( Invocation.method( @@ -1077,7 +1021,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future addUserScript(_i4.WKUserScript? userScript) => (super.noSuchMethod( @@ -1088,7 +1031,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeAllUserScripts() => (super.noSuchMethod( Invocation.method( @@ -1098,7 +1040,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i4.WKUserContentController copy() => (super.noSuchMethod( Invocation.method( @@ -1113,7 +1054,6 @@ class MockWKUserContentController extends _i1.Mock ), ), ) as _i4.WKUserContentController); - @override _i5.Future addObserver( _i7.NSObject? observer, { @@ -1132,7 +1072,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i5.Future.value(), returnValueForMissingStub: _i5.Future.value(), ) as _i5.Future); - @override _i5.Future removeObserver( _i7.NSObject? observer, { @@ -1163,7 +1102,6 @@ class MockJavascriptChannelRegistry extends _i1.Mock Invocation.getter(#channels), returnValue: {}, ) as Map); - @override void onJavascriptChannelMessage( String? channel, @@ -1179,7 +1117,6 @@ class MockJavascriptChannelRegistry extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void updateJavascriptChannelsFromSet(Set<_i9.JavascriptChannel>? channels) => super.noSuchMethod( @@ -1216,7 +1153,6 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValue: _i5.Future.value(false), ) as _i5.FutureOr); - @override void onPageStarted(String? url) => super.noSuchMethod( Invocation.method( @@ -1225,7 +1161,6 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void onPageFinished(String? url) => super.noSuchMethod( Invocation.method( @@ -1234,7 +1169,6 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void onProgress(int? progress) => super.noSuchMethod( Invocation.method( @@ -1243,7 +1177,6 @@ class MockWebViewPlatformCallbacksHandler extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void onWebResourceError(_i10.WebResourceError? error) => super.noSuchMethod( Invocation.method( @@ -1287,7 +1220,6 @@ class MockWebViewWidgetProxy extends _i1.Mock ), ), ) as _i4.WKWebView); - @override _i4.WKScriptMessageHandler createScriptMessageHandler( {required void Function( @@ -1309,7 +1241,6 @@ class MockWebViewWidgetProxy extends _i1.Mock ), ), ) as _i4.WKScriptMessageHandler); - @override _i4.WKUIDelegate createUIDelgate( {void Function( @@ -1332,7 +1263,6 @@ class MockWebViewWidgetProxy extends _i1.Mock ), ), ) as _i4.WKUIDelegate); - @override _i4.WKNavigationDelegate createNavigationDelegate({ void Function( diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.mocks.dart index ef232088418b..94306ea553e9 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/src/foundation/foundation_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_wkwebview/test/src/foundation/foundation_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'package:mockito/mockito.dart' as _i1; import 'package:webview_flutter_wkwebview/src/common/web_kit.g.dart' as _i3; @@ -12,8 +14,6 @@ import '../common/test_web_kit.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -38,7 +38,6 @@ class MockTestNSObjectHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void addObserver( int? identifier, @@ -58,7 +57,6 @@ class MockTestNSObjectHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void removeObserver( int? identifier, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.mocks.dart index 2ce998175493..81ef6a8ca9d6 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_wkwebview/test/src/ui_kit/ui_kit_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i4; @@ -14,8 +16,6 @@ import '../common/test_web_kit.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -40,7 +40,6 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void createFromWebView( int? identifier, @@ -56,7 +55,6 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setAllowsInlineMediaPlayback( int? identifier, @@ -72,7 +70,6 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setLimitsNavigationsToAppBoundDomains( int? identifier, @@ -88,7 +85,6 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setMediaTypesRequiringUserActionForPlayback( int? identifier, @@ -130,7 +126,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setUIDelegate( int? identifier, @@ -146,7 +141,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setNavigationDelegate( int? identifier, @@ -162,13 +156,11 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override String? getUrl(int? identifier) => (super.noSuchMethod(Invocation.method( #getUrl, [identifier], )) as String?); - @override double getEstimatedProgress(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -177,7 +169,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: 0.0, ) as double); - @override void loadRequest( int? identifier, @@ -193,7 +184,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void loadHtmlString( int? identifier, @@ -211,7 +201,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void loadFileUrl( int? identifier, @@ -229,7 +218,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void loadFlutterAsset( int? identifier, @@ -245,7 +233,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override bool canGoBack(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -254,7 +241,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: false, ) as bool); - @override bool canGoForward(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -263,7 +249,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: false, ) as bool); - @override void goBack(int? identifier) => super.noSuchMethod( Invocation.method( @@ -272,7 +257,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void goForward(int? identifier) => super.noSuchMethod( Invocation.method( @@ -281,7 +265,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void reload(int? identifier) => super.noSuchMethod( Invocation.method( @@ -290,13 +273,11 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override String? getTitle(int? identifier) => (super.noSuchMethod(Invocation.method( #getTitle, [identifier], )) as String?); - @override void setAllowsBackForwardNavigationGestures( int? identifier, @@ -312,7 +293,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setCustomUserAgent( int? identifier, @@ -328,7 +308,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i4.Future evaluateJavaScript( int? identifier, @@ -344,7 +323,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: _i4.Future.value(), ) as _i4.Future); - @override void setInspectable( int? identifier, @@ -360,7 +338,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override String? getCustomUserAgent(int? identifier) => (super.noSuchMethod(Invocation.method( @@ -393,7 +370,6 @@ class MockTestUIScrollViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override List getContentOffset(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -402,7 +378,6 @@ class MockTestUIScrollViewHostApi extends _i1.Mock ), returnValue: [], ) as List); - @override void scrollBy( int? identifier, @@ -420,7 +395,6 @@ class MockTestUIScrollViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setContentOffset( int? identifier, @@ -463,7 +437,6 @@ class MockTestUIViewHostApi extends _i1.Mock implements _i2.TestUIViewHostApi { ), returnValueForMissingStub: null, ); - @override void setOpaque( int? identifier, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.mocks.dart index 96e3622de39d..2343af2f17ff 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/src/web_kit/web_kit_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_wkwebview/test/src/web_kit/web_kit_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -14,8 +16,6 @@ import '../common/test_web_kit.g.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -47,7 +47,6 @@ class MockTestWKHttpCookieStoreHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i3.Future setCookie( int? identifier, @@ -109,7 +108,6 @@ class MockTestWKPreferencesHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setJavaScriptEnabled( int? identifier, @@ -189,7 +187,6 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void addScriptMessageHandler( int? identifier, @@ -207,7 +204,6 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void removeScriptMessageHandler( int? identifier, @@ -223,7 +219,6 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void removeAllScriptMessageHandlers(int? identifier) => super.noSuchMethod( Invocation.method( @@ -232,7 +227,6 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void addUserScript( int? identifier, @@ -248,7 +242,6 @@ class MockTestWKUserContentControllerHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void removeAllUserScripts(int? identifier) => super.noSuchMethod( Invocation.method( @@ -276,7 +269,6 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void createFromWebView( int? identifier, @@ -292,7 +284,6 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setAllowsInlineMediaPlayback( int? identifier, @@ -308,7 +299,6 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setLimitsNavigationsToAppBoundDomains( int? identifier, @@ -324,7 +314,6 @@ class MockTestWKWebViewConfigurationHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setMediaTypesRequiringUserActionForPlayback( int? identifier, @@ -366,7 +355,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setUIDelegate( int? identifier, @@ -382,7 +370,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setNavigationDelegate( int? identifier, @@ -398,13 +385,11 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override String? getUrl(int? identifier) => (super.noSuchMethod(Invocation.method( #getUrl, [identifier], )) as String?); - @override double getEstimatedProgress(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -413,7 +398,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: 0.0, ) as double); - @override void loadRequest( int? identifier, @@ -429,7 +413,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void loadHtmlString( int? identifier, @@ -447,7 +430,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void loadFileUrl( int? identifier, @@ -465,7 +447,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void loadFlutterAsset( int? identifier, @@ -481,7 +462,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override bool canGoBack(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -490,7 +470,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: false, ) as bool); - @override bool canGoForward(int? identifier) => (super.noSuchMethod( Invocation.method( @@ -499,7 +478,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: false, ) as bool); - @override void goBack(int? identifier) => super.noSuchMethod( Invocation.method( @@ -508,7 +486,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void goForward(int? identifier) => super.noSuchMethod( Invocation.method( @@ -517,7 +494,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void reload(int? identifier) => super.noSuchMethod( Invocation.method( @@ -526,13 +502,11 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override String? getTitle(int? identifier) => (super.noSuchMethod(Invocation.method( #getTitle, [identifier], )) as String?); - @override void setAllowsBackForwardNavigationGestures( int? identifier, @@ -548,7 +522,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void setCustomUserAgent( int? identifier, @@ -564,7 +537,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i3.Future evaluateJavaScript( int? identifier, @@ -580,7 +552,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValue: _i3.Future.value(), ) as _i3.Future); - @override void setInspectable( int? identifier, @@ -596,7 +567,6 @@ class MockTestWKWebViewHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override String? getCustomUserAgent(int? identifier) => (super.noSuchMethod(Invocation.method( @@ -629,7 +599,6 @@ class MockTestWKWebsiteDataStoreHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override void createDefaultDataStore(int? identifier) => super.noSuchMethod( Invocation.method( @@ -638,7 +607,6 @@ class MockTestWKWebsiteDataStoreHostApi extends _i1.Mock ), returnValueForMissingStub: null, ); - @override _i3.Future removeDataOfTypes( int? identifier, diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart index 43b30e59df9f..08bd48041606 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_controller_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_wkwebview/test/webkit_webview_controller_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i6; import 'dart:math' as _i3; @@ -17,8 +19,6 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i5; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -148,7 +148,6 @@ class MockNSUrl extends _i1.Mock implements _i2.NSUrl { ), returnValue: _i6.Future.value(), ) as _i6.Future); - @override _i2.NSObject copy() => (super.noSuchMethod( Invocation.method( @@ -163,7 +162,6 @@ class MockNSUrl extends _i1.Mock implements _i2.NSUrl { ), ), ) as _i2.NSObject); - @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -182,7 +180,6 @@ class MockNSUrl extends _i1.Mock implements _i2.NSUrl { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -222,7 +219,6 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { ), )), ) as _i6.Future<_i3.Point>); - @override _i6.Future scrollBy(_i3.Point? offset) => (super.noSuchMethod( Invocation.method( @@ -232,7 +228,6 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setContentOffset(_i3.Point? offset) => (super.noSuchMethod( @@ -243,7 +238,6 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i4.UIScrollView copy() => (super.noSuchMethod( Invocation.method( @@ -258,7 +252,6 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { ), ), ) as _i4.UIScrollView); - @override _i6.Future setBackgroundColor(_i7.Color? color) => (super.noSuchMethod( Invocation.method( @@ -268,7 +261,6 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setOpaque(bool? opaque) => (super.noSuchMethod( Invocation.method( @@ -278,7 +270,6 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -297,7 +288,6 @@ class MockUIScrollView extends _i1.Mock implements _i4.UIScrollView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -332,7 +322,6 @@ class MockWKPreferences extends _i1.Mock implements _i5.WKPreferences { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i5.WKPreferences copy() => (super.noSuchMethod( Invocation.method( @@ -347,7 +336,6 @@ class MockWKPreferences extends _i1.Mock implements _i5.WKPreferences { ), ), ) as _i5.WKPreferences); - @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -366,7 +354,6 @@ class MockWKPreferences extends _i1.Mock implements _i5.WKPreferences { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -409,7 +396,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeScriptMessageHandler(String? name) => (super.noSuchMethod( @@ -420,7 +406,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeAllScriptMessageHandlers() => (super.noSuchMethod( Invocation.method( @@ -430,7 +415,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future addUserScript(_i5.WKUserScript? userScript) => (super.noSuchMethod( @@ -441,7 +425,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeAllUserScripts() => (super.noSuchMethod( Invocation.method( @@ -451,7 +434,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i5.WKUserContentController copy() => (super.noSuchMethod( Invocation.method( @@ -466,7 +448,6 @@ class MockWKUserContentController extends _i1.Mock ), ), ) as _i5.WKUserContentController); - @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -485,7 +466,6 @@ class MockWKUserContentController extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -520,7 +500,6 @@ class MockWKWebsiteDataStore extends _i1.Mock Invocation.getter(#httpCookieStore), ), ) as _i5.WKHttpCookieStore); - @override _i6.Future removeDataOfTypes( Set<_i5.WKWebsiteDataType>? dataTypes, @@ -536,7 +515,6 @@ class MockWKWebsiteDataStore extends _i1.Mock ), returnValue: _i6.Future.value(false), ) as _i6.Future); - @override _i5.WKWebsiteDataStore copy() => (super.noSuchMethod( Invocation.method( @@ -551,7 +529,6 @@ class MockWKWebsiteDataStore extends _i1.Mock ), ), ) as _i5.WKWebsiteDataStore); - @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -570,7 +547,6 @@ class MockWKWebsiteDataStore extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -604,7 +580,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { Invocation.getter(#configuration), ), ) as _i5.WKWebViewConfiguration); - @override _i4.UIScrollView get scrollView => (super.noSuchMethod( Invocation.getter(#scrollView), @@ -613,7 +588,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { Invocation.getter(#scrollView), ), ) as _i4.UIScrollView); - @override _i6.Future setUIDelegate(_i5.WKUIDelegate? delegate) => (super.noSuchMethod( @@ -624,7 +598,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setNavigationDelegate(_i5.WKNavigationDelegate? delegate) => (super.noSuchMethod( @@ -635,7 +608,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future getUrl() => (super.noSuchMethod( Invocation.method( @@ -644,7 +616,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future getEstimatedProgress() => (super.noSuchMethod( Invocation.method( @@ -653,7 +624,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(0.0), ) as _i6.Future); - @override _i6.Future loadRequest(_i2.NSUrlRequest? request) => (super.noSuchMethod( @@ -664,7 +634,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future loadHtmlString( String? string, { @@ -679,7 +648,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future loadFileUrl( String? url, { @@ -694,7 +662,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future loadFlutterAsset(String? key) => (super.noSuchMethod( Invocation.method( @@ -704,7 +671,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future canGoBack() => (super.noSuchMethod( Invocation.method( @@ -713,7 +679,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(false), ) as _i6.Future); - @override _i6.Future canGoForward() => (super.noSuchMethod( Invocation.method( @@ -722,7 +687,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(false), ) as _i6.Future); - @override _i6.Future goBack() => (super.noSuchMethod( Invocation.method( @@ -732,7 +696,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future goForward() => (super.noSuchMethod( Invocation.method( @@ -742,7 +705,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future reload() => (super.noSuchMethod( Invocation.method( @@ -752,7 +714,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future getTitle() => (super.noSuchMethod( Invocation.method( @@ -761,7 +722,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setAllowsBackForwardNavigationGestures(bool? allow) => (super.noSuchMethod( @@ -772,7 +732,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setCustomUserAgent(String? userAgent) => (super.noSuchMethod( Invocation.method( @@ -782,7 +741,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future evaluateJavaScript(String? javaScriptString) => (super.noSuchMethod( @@ -792,7 +750,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setInspectable(bool? inspectable) => (super.noSuchMethod( Invocation.method( @@ -802,7 +759,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future getCustomUserAgent() => (super.noSuchMethod( Invocation.method( @@ -811,7 +767,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), returnValue: _i6.Future.value(), ) as _i6.Future); - @override _i5.WKWebView copy() => (super.noSuchMethod( Invocation.method( @@ -826,7 +781,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { ), ), ) as _i5.WKWebView); - @override _i6.Future setBackgroundColor(_i7.Color? color) => (super.noSuchMethod( Invocation.method( @@ -836,7 +790,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setOpaque(bool? opaque) => (super.noSuchMethod( Invocation.method( @@ -846,7 +799,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -865,7 +817,6 @@ class MockWKWebView extends _i1.Mock implements _i5.WKWebView { returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -900,7 +851,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#userContentController), ), ) as _i5.WKUserContentController); - @override _i5.WKPreferences get preferences => (super.noSuchMethod( Invocation.getter(#preferences), @@ -909,7 +859,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#preferences), ), ) as _i5.WKPreferences); - @override _i5.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( Invocation.getter(#websiteDataStore), @@ -918,7 +867,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#websiteDataStore), ), ) as _i5.WKWebsiteDataStore); - @override _i6.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( @@ -929,7 +877,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( @@ -940,7 +887,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future setMediaTypesRequiringUserActionForPlayback( Set<_i5.WKAudiovisualMediaType>? types) => @@ -952,7 +898,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i5.WKWebViewConfiguration copy() => (super.noSuchMethod( Invocation.method( @@ -967,7 +912,6 @@ class MockWKWebViewConfiguration extends _i1.Mock ), ), ) as _i5.WKWebViewConfiguration); - @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -986,7 +930,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeObserver( _i2.NSObject? observer, { @@ -1027,7 +970,6 @@ class MockWKScriptMessageHandler extends _i1.Mock _i5.WKUserContentController, _i5.WKScriptMessage, )); - @override _i5.WKScriptMessageHandler copy() => (super.noSuchMethod( Invocation.method( @@ -1042,7 +984,6 @@ class MockWKScriptMessageHandler extends _i1.Mock ), ), ) as _i5.WKScriptMessageHandler); - @override _i6.Future addObserver( _i2.NSObject? observer, { @@ -1061,7 +1002,6 @@ class MockWKScriptMessageHandler extends _i1.Mock returnValue: _i6.Future.value(), returnValueForMissingStub: _i6.Future.value(), ) as _i6.Future); - @override _i6.Future removeObserver( _i2.NSObject? observer, { diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart index 50ad2794e093..042631982cf5 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_wkwebview/test/webkit_webview_cookie_manager_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -14,8 +16,6 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -63,7 +63,6 @@ class MockWKWebsiteDataStore extends _i1.Mock Invocation.getter(#httpCookieStore), ), ) as _i2.WKHttpCookieStore); - @override _i3.Future removeDataOfTypes( Set<_i2.WKWebsiteDataType>? dataTypes, @@ -79,7 +78,6 @@ class MockWKWebsiteDataStore extends _i1.Mock ), returnValue: _i3.Future.value(false), ) as _i3.Future); - @override _i2.WKWebsiteDataStore copy() => (super.noSuchMethod( Invocation.method( @@ -94,7 +92,6 @@ class MockWKWebsiteDataStore extends _i1.Mock ), ), ) as _i2.WKWebsiteDataStore); - @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -113,7 +110,6 @@ class MockWKWebsiteDataStore extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future removeObserver( _i4.NSObject? observer, { @@ -148,7 +144,6 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i2.WKHttpCookieStore copy() => (super.noSuchMethod( Invocation.method( @@ -163,7 +158,6 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { ), ), ) as _i2.WKHttpCookieStore); - @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -182,7 +176,6 @@ class MockWKHttpCookieStore extends _i1.Mock implements _i2.WKHttpCookieStore { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future removeObserver( _i4.NSObject? observer, { diff --git a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart index 942d78267eaa..8d104c1ed79d 100644 --- a/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart +++ b/packages/webview_flutter/webview_flutter_wkwebview/test/webkit_webview_widget_test.mocks.dart @@ -1,7 +1,9 @@ -// Mocks generated by Mockito 5.4.3 from annotations +// Mocks generated by Mockito 5.4.1 from annotations // in webview_flutter_wkwebview/test/webkit_webview_widget_test.dart. // Do not manually edit this file. +// @dart=2.19 + // ignore_for_file: no_leading_underscores_for_library_prefixes import 'dart:async' as _i3; @@ -14,8 +16,6 @@ import 'package:webview_flutter_wkwebview/src/web_kit/web_kit.dart' as _i2; // ignore_for_file: avoid_redundant_argument_values // ignore_for_file: avoid_setters_without_getters // ignore_for_file: comment_references -// ignore_for_file: deprecated_member_use -// ignore_for_file: deprecated_member_use_from_same_package // ignore_for_file: implementation_imports // ignore_for_file: invalid_use_of_visible_for_testing_member // ignore_for_file: prefer_const_constructors @@ -99,7 +99,6 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { ), ), ) as _i2.WKUIDelegate); - @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -118,7 +117,6 @@ class MockWKUIDelegate extends _i1.Mock implements _i2.WKUIDelegate { returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future removeObserver( _i4.NSObject? observer, { @@ -153,7 +151,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#userContentController), ), ) as _i2.WKUserContentController); - @override _i2.WKPreferences get preferences => (super.noSuchMethod( Invocation.getter(#preferences), @@ -162,7 +159,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#preferences), ), ) as _i2.WKPreferences); - @override _i2.WKWebsiteDataStore get websiteDataStore => (super.noSuchMethod( Invocation.getter(#websiteDataStore), @@ -171,7 +167,6 @@ class MockWKWebViewConfiguration extends _i1.Mock Invocation.getter(#websiteDataStore), ), ) as _i2.WKWebsiteDataStore); - @override _i3.Future setAllowsInlineMediaPlayback(bool? allow) => (super.noSuchMethod( @@ -182,7 +177,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future setLimitsNavigationsToAppBoundDomains(bool? limit) => (super.noSuchMethod( @@ -193,7 +187,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future setMediaTypesRequiringUserActionForPlayback( Set<_i2.WKAudiovisualMediaType>? types) => @@ -205,7 +198,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i2.WKWebViewConfiguration copy() => (super.noSuchMethod( Invocation.method( @@ -220,7 +212,6 @@ class MockWKWebViewConfiguration extends _i1.Mock ), ), ) as _i2.WKWebViewConfiguration); - @override _i3.Future addObserver( _i4.NSObject? observer, { @@ -239,7 +230,6 @@ class MockWKWebViewConfiguration extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); - @override _i3.Future removeObserver( _i4.NSObject? observer, { diff --git a/script/configs/still_requires_api_33_avd.yaml b/script/configs/still_requires_api_33_avd.yaml index 7368d3d16e0c..097ff51bdad7 100644 --- a/script/configs/still_requires_api_33_avd.yaml +++ b/script/configs/still_requires_api_33_avd.yaml @@ -1,2 +1,3 @@ # Running the somes tests from these packages on an AVD with Android 34 causes failures. +- quick_actions - webview_flutter diff --git a/script/configs/temp_exclude_excerpt.yaml b/script/configs/temp_exclude_excerpt.yaml index 938d101daca3..2bea7dcb7ddf 100644 --- a/script/configs/temp_exclude_excerpt.yaml +++ b/script/configs/temp_exclude_excerpt.yaml @@ -5,10 +5,17 @@ # TODO(stuartmorgan): Remove everything from this list. See # https://github.com/flutter/flutter/issues/102679 +- cross_file +- css_colors - espresso +- extension_google_sign_in_as_googleapis_auth +- flutter_image - go_router_builder +- google_sign_in/google_sign_in - image_picker_for_web - in_app_purchase/in_app_purchase +- ios_platform_images +- multicast_dns - palette_generator - pointer_interceptor - quick_actions/quick_actions diff --git a/script/tool/lib/src/pubspec_check_command.dart b/script/tool/lib/src/pubspec_check_command.dart index 378dfc65caa8..bccdad5c7853 100644 --- a/script/tool/lib/src/pubspec_check_command.dart +++ b/script/tool/lib/src/pubspec_check_command.dart @@ -332,7 +332,7 @@ class PubspecCheckCommand extends PackageLoopingCommand { false; } - // Validates the "topics" keyword for a plugin, returning an error + // Validates the "implements" keyword for a plugin, returning an error // string if there are any issues. String? _checkTopics( Pubspec pubspec, { @@ -343,10 +343,6 @@ class PubspecCheckCommand extends PackageLoopingCommand { return 'A published package should include "topics". ' 'See https://dart.dev/tools/pub/pubspec#topics.'; } - if (topics.length > 5) { - return 'A published package should have maximum 5 topics. ' - 'See https://dart.dev/tools/pub/pubspec#topics.'; - } if (isFlutterPlugin(package) && package.isFederated) { final String pluginName = package.directory.parent.basename; // '_' isn't allowed in topics, so convert to '-'. @@ -356,19 +352,6 @@ class PubspecCheckCommand extends PackageLoopingCommand { 'a topic. Add "$topicName" to the "topics" section.'; } } - - // Validates topic names according to https://dart.dev/tools/pub/pubspec#topics - final RegExp expectedTopicFormat = RegExp(r'^[a-z](?:-?[a-z0-9]+)*$'); - final Iterable invalidTopics = topics.where((String topic) => - !expectedTopicFormat.hasMatch(topic) || - topic.length < 2 || - topic.length > 32); - if (invalidTopics.isNotEmpty) { - return 'Invalid topic(s): ${invalidTopics.join(', ')} in "topics" section. ' - 'Topics must consist of lowercase alphanumerical characters or dash (but no double dash), ' - 'start with a-z and ending with a-z or 0-9, have a minimum of 2 characters ' - 'and have a maximum of 32 characters.'; - } return null; } diff --git a/script/tool/lib/src/update_dependency_command.dart b/script/tool/lib/src/update_dependency_command.dart index 341706485ecc..548465c5f338 100644 --- a/script/tool/lib/src/update_dependency_command.dart +++ b/script/tool/lib/src/update_dependency_command.dart @@ -273,33 +273,23 @@ ${response.httpResponse.body} } updateRanForExamples = true; - final Directory androidDirectory = + Directory androidDirectory = example.platformDirectory(FlutterPlatform.android); - final List filesToUpdate = []; + final File fileToUpdate; final RegExp dependencyVersionPattern; final String newDependencyVersionEntry; if (_targetAndroidDependency == _AndroidDepdencyType.gradle) { if (androidDirectory + .childDirectory('app') .childDirectory('gradle') - .childDirectory('wrapper') .existsSync()) { - filesToUpdate.add(androidDirectory - .childDirectory('gradle') - .childDirectory('wrapper') - .childFile('gradle-wrapper.properties')); + androidDirectory = androidDirectory.childDirectory('app'); } - if (androidDirectory - .childDirectory('app') + fileToUpdate = androidDirectory .childDirectory('gradle') .childDirectory('wrapper') - .existsSync()) { - filesToUpdate.add(androidDirectory - .childDirectory('app') - .childDirectory('gradle') - .childDirectory('wrapper') - .childFile('gradle-wrapper.properties')); - } + .childFile('gradle-wrapper.properties'); dependencyVersionPattern = RegExp(r'^\s*distributionUrl\s*=\s*.*\.zip', multiLine: true); // TODO(camsim99): Validate current AGP version against target Gradle @@ -308,8 +298,8 @@ ${response.httpResponse.body} 'distributionUrl=https\\://services.gradle.org/distributions/gradle-$_targetVersion-all.zip'; } else if (_targetAndroidDependency == _AndroidDepdencyType.compileSdkForExamples) { - filesToUpdate.add( - androidDirectory.childDirectory('app').childFile('build.gradle')); + fileToUpdate = + androidDirectory.childDirectory('app').childFile('build.gradle'); dependencyVersionPattern = RegExp( r'(compileSdk|compileSdkVersion) (\d{1,2}|flutter.compileSdkVersion)'); newDependencyVersionEntry = 'compileSdk $_targetVersion'; @@ -319,23 +309,20 @@ ${response.httpResponse.body} throw ToolExit(_exitIncorrectTargetDependency); } - for (final File fileToUpdate in filesToUpdate) { - final String oldFileToUpdateContents = fileToUpdate.readAsStringSync(); + final String oldFileToUpdateContents = fileToUpdate.readAsStringSync(); - if (!dependencyVersionPattern.hasMatch(oldFileToUpdateContents)) { - return PackageResult.fail([ - 'Unable to find a $_targetAndroidDependency version entry to update for ${example.displayName}.' - ]); - } + if (!dependencyVersionPattern.hasMatch(oldFileToUpdateContents)) { + return PackageResult.fail([ + 'Unable to find a $_targetAndroidDependency version entry to update for ${example.displayName}.' + ]); + } - print( - '${indentation}Updating ${getRelativePosixPath(example.directory, from: package.directory)} to "$_targetVersion"'); - final String newGradleWrapperPropertiesContents = - oldFileToUpdateContents.replaceFirst( - dependencyVersionPattern, newDependencyVersionEntry); + print( + '${indentation}Updating ${getRelativePosixPath(example.directory, from: package.directory)} to "$_targetVersion"'); + final String newGradleWrapperPropertiesContents = oldFileToUpdateContents + .replaceFirst(dependencyVersionPattern, newDependencyVersionEntry); - fileToUpdate.writeAsStringSync(newGradleWrapperPropertiesContents); - } + fileToUpdate.writeAsStringSync(newGradleWrapperPropertiesContents); } return updateRanForExamples ? PackageResult.success() diff --git a/script/tool/lib/src/update_excerpts_command.dart b/script/tool/lib/src/update_excerpts_command.dart index 24381bf6d33c..6904dfdf02f9 100644 --- a/script/tool/lib/src/update_excerpts_command.dart +++ b/script/tool/lib/src/update_excerpts_command.dart @@ -146,12 +146,6 @@ class UpdateExcerptsCommand extends PackageLoopingCommand { case '.cpp': language = 'c++'; break; - case '.m': - language = 'objectivec'; - break; - case '.gradle': - language = 'groovy'; - break; default: language = extension.substring(1); break; @@ -245,9 +239,6 @@ class UpdateExcerptsCommand extends PackageLoopingCommand { case 'js': case 'kotlin': case 'rfwtxt': - case 'java': - case 'groovy': - case 'objectivec': case 'swift': prefix = '// '; break; @@ -264,9 +255,6 @@ class UpdateExcerptsCommand extends PackageLoopingCommand { case 'yaml': prefix = '# '; break; - case 'sh': - prefix = '# '; - break; } final String startRegionMarker = '$prefix#docregion $section$suffix'; final String endRegionMarker = '$prefix#enddocregion $section$suffix'; diff --git a/script/tool/lib/src/update_min_sdk_command.dart b/script/tool/lib/src/update_min_sdk_command.dart index c1c86e8f2cd3..e7a3218ea916 100644 --- a/script/tool/lib/src/update_min_sdk_command.dart +++ b/script/tool/lib/src/update_min_sdk_command.dart @@ -69,8 +69,16 @@ class UpdateMinSdkCommand extends PackageLoopingCommand { YamlEditor(package.pubspecFile.readAsStringSync()); if (dartRange != null && (dartRange.min ?? Version.none) < _dartMinVersion) { - editablePubspec - .update([environmentKey, dartSdkKey], '^$_dartMinVersion'); + Version upperBound = _dartMinVersion.nextMajor; + // pub special-cases 3.0.0 as an upper bound to be treated as 4.0.0, and + // using 3.0.0 is now an error at upload time, so special case it here. + if (upperBound.major == 3) { + upperBound = upperBound.nextMajor; + } + editablePubspec.update( + [environmentKey, dartSdkKey], + VersionRange(min: _dartMinVersion, includeMin: true, max: upperBound) + .toString()); print('${indentation}Updating Dart minimum to $_dartMinVersion'); } if (flutterRange != null && diff --git a/script/tool/test/pubspec_check_command_test.dart b/script/tool/test/pubspec_check_command_test.dart index 8e99d720f57f..60bcc2d47849 100644 --- a/script/tool/test/pubspec_check_command_test.dart +++ b/script/tool/test/pubspec_check_command_test.dart @@ -633,270 +633,6 @@ ${_topicsSection()} ); }); - test('fails when topic name contains a space', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection(['plugin a'])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains('Invalid topic(s): plugin a in "topics" section. '), - ]), - ); - }); - - test('fails when topic a topic name contains double dash', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection(['plugin--a'])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains('Invalid topic(s): plugin--a in "topics" section. '), - ]), - ); - }); - - test('fails when topic a topic name starts with a number', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection(['1plugin-a'])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains('Invalid topic(s): 1plugin-a in "topics" section. '), - ]), - ); - }); - - test('fails when topic a topic name contains uppercase', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection(['plugin-A'])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains('Invalid topic(s): plugin-A in "topics" section. '), - ]), - ); - }); - - test('fails when there are more than 5 topics', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection([ - 'plugin-a', - 'plugin-a', - 'plugin-a', - 'plugin-a', - 'plugin-a', - 'plugin-a' - ])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains( - ' A published package should have maximum 5 topics. See https://dart.dev/tools/pub/pubspec#topics.'), - ]), - ); - }); - - test('fails if a topic name is longer than 32 characters', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection(['foobarfoobarfoobarfoobarfoobarfoobarfoo'])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains( - 'Invalid topic(s): foobarfoobarfoobarfoobarfoobarfoobarfoo in "topics" section. '), - ]), - ); - }); - - test('fails if a topic name is longer than 2 characters', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection(['a'])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains('Invalid topic(s): a in "topics" section. '), - ]), - ); - }); - - test('fails if a topic name ends in a dash', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection(['plugin-'])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains('Invalid topic(s): plugin- in "topics" section. '), - ]), - ); - }); - - test('Invalid topics section has expected error message', () async { - final RepositoryPackage plugin = - createFakePlugin('plugin', packagesDir, examples: []); - - plugin.pubspecFile.writeAsStringSync(''' -${_headerSection('plugin')} -${_environmentSection()} -${_flutterSection(isPlugin: true)} -${_dependenciesSection()} -${_devDependenciesSection()} -${_topicsSection(['plugin-A', 'Plugin-b'])} -'''); - - Error? commandError; - final List output = await runCapturingPrint( - runner, ['pubspec-check'], errorHandler: (Error e) { - commandError = e; - }); - - expect(commandError, isA()); - expect( - output, - containsAllInOrder([ - contains('Invalid topic(s): plugin-A, Plugin-b in "topics" section. ' - 'Topics must consist of lowercase alphanumerical characters or dash (but no double dash), ' - 'start with a-z and ending with a-z or 0-9, have a minimum of 2 characters ' - 'and have a maximum of 32 characters.'), - ]), - ); - }); - test('fails when environment section is out of order', () async { final RepositoryPackage plugin = createFakePlugin('plugin', packagesDir, examples: []); diff --git a/script/tool/test/update_dependency_command_test.dart b/script/tool/test/update_dependency_command_test.dart index 2cb6b15b12c6..deee0d629b87 100644 --- a/script/tool/test/update_dependency_command_test.dart +++ b/script/tool/test/update_dependency_command_test.dart @@ -780,73 +780,6 @@ distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip 'gradle-$newGradleVersion-all.zip')); }); - test( - 'succeeds if example app has android/gradle and android/app/gradle directory structure', - () async { - final RepositoryPackage package = - createFakePlugin('fake_plugin', packagesDir, extraFiles: [ - 'example/android/gradle/wrapper/gradle-wrapper.properties', - 'example/android/app/gradle/wrapper/gradle-wrapper.properties' - ]); - const String newGradleVersion = '9.9'; - - final File gradleWrapperPropertiesFile = package.directory - .childDirectory('example') - .childDirectory('android') - .childDirectory('gradle') - .childDirectory('wrapper') - .childFile('gradle-wrapper.properties'); - - final File gradleAppWrapperPropertiesFile = package.directory - .childDirectory('example') - .childDirectory('android') - .childDirectory('app') - .childDirectory('gradle') - .childDirectory('wrapper') - .childFile('gradle-wrapper.properties'); - - gradleWrapperPropertiesFile.writeAsStringSync(r''' -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip -'''); - - gradleAppWrapperPropertiesFile.writeAsStringSync(r''' -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip -'''); - - await runCapturingPrint(runner, [ - 'update-dependency', - '--packages', - package.displayName, - '--android-dependency', - 'gradle', - '--version', - newGradleVersion, - ]); - - final String updatedGradleWrapperPropertiesContents = - gradleWrapperPropertiesFile.readAsStringSync(); - final String updatedGradleAppWrapperPropertiesContents = - gradleAppWrapperPropertiesFile.readAsStringSync(); - expect( - updatedGradleWrapperPropertiesContents, - contains( - r'distributionUrl=https\://services.gradle.org/distributions/' - 'gradle-$newGradleVersion-all.zip')); - expect( - updatedGradleAppWrapperPropertiesContents, - contains( - r'distributionUrl=https\://services.gradle.org/distributions/' - 'gradle-$newGradleVersion-all.zip')); - }); - test('succeeds if one example app runs on Android and another does not', () async { final RepositoryPackage package = createFakePlugin( diff --git a/script/tool/test/update_excerpts_command_test.dart b/script/tool/test/update_excerpts_command_test.dart index 187f0d8d5983..71cf836616bf 100644 --- a/script/tool/test/update_excerpts_command_test.dart +++ b/script/tool/test/update_excerpts_command_test.dart @@ -33,16 +33,12 @@ void runAllTests(MockPlatform platform) { )); }); - Future testInjection( - {required String before, - required String source, - required String after, - required String filename, - bool failOnChange = false}) async { + Future testInjection(String before, String source, String after, + {bool failOnChange = false}) async { final RepositoryPackage package = createFakePackage('a_package', packagesDir); package.readmeFile.writeAsStringSync(before); - package.directory.childFile(filename).writeAsStringSync(source); + package.directory.childFile('main.dart').writeAsStringSync(source); Object? errorObject; final List output = await runCapturingPrint( runner, @@ -61,12 +57,10 @@ void runAllTests(MockPlatform platform) { } test('succeeds when nothing has changed', () async { - const String filename = 'main.dart'; - const String readme = ''' Example: - + ```dart A B C ``` @@ -78,8 +72,7 @@ A B C // #enddocregion SomeSection FAIL '''; - await testInjection( - before: readme, source: source, after: readme, filename: filename); + await testInjection(readme, source, readme); }); test('fails if example injection fails', () async { @@ -119,36 +112,31 @@ FAIL }); test('updates files', () async { - const String filename = 'main.dart'; - - const String before = ''' + await testInjection( + ''' Example: - + ```dart X Y Z ``` -'''; - - const String source = ''' +''', + ''' FAIL // #docregion SomeSection A B C // #enddocregion SomeSection FAIL -'''; - - const String after = ''' +''', + ''' Example: - + ```dart A B C ``` -'''; - - await testInjection( - before: before, source: source, after: after, filename: filename); +''', + ); }); test('fails if READMEs are changed with --fail-on-change', () async { @@ -186,177 +174,151 @@ FAIL test('does not fail if READMEs are not changed with --fail-on-change', () async { - const String filename = 'main.dart'; - const String readme = ''' Example: - + ```dart A ``` - + ```dart B ``` '''; - - const String source = ''' + await testInjection( + readme, + ''' // #docregion aa A // #enddocregion aa // #docregion bb B // #enddocregion bb -'''; - - await testInjection( - before: readme, - source: source, - after: readme, - filename: filename, +''', + readme, failOnChange: true, ); }); test('indents the plaster', () async { - const String filename = 'main.dart'; - - const String before = ''' + await testInjection( + ''' Example: - + ```dart ``` -'''; - - const String source = ''' +''', + ''' // #docregion SomeSection A // #enddocregion SomeSection // #docregion SomeSection B // #enddocregion SomeSection -'''; - - const String after = ''' +''', + ''' Example: - + ```dart A // ··· B ``` -'''; - - await testInjection( - before: before, source: source, after: after, filename: filename); +''', + ); }); test('does not unindent blocks if plaster will not unindent', () async { - const String filename = 'main.dart'; - - const String before = ''' + await testInjection( + ''' Example: - + ```dart ``` -'''; - - const String source = ''' +''', + ''' // #docregion SomeSection A // #enddocregion SomeSection // #docregion SomeSection B // #enddocregion SomeSection -'''; - - const String after = ''' +''', + ''' Example: - + ```dart A // ··· B ``` -'''; - - await testInjection( - before: before, source: source, after: after, filename: filename); +''', + ); }); test('unindents blocks', () async { - const String filename = 'main.dart'; - - const String before = ''' + await testInjection( + ''' Example: - + ```dart ``` -'''; - - const String source = ''' +''', + ''' // #docregion SomeSection A // #enddocregion SomeSection // #docregion SomeSection B // #enddocregion SomeSection -'''; - - const String after = ''' +''', + ''' Example: - + ```dart A // ··· B ``` -'''; - - await testInjection( - before: before, source: source, after: after, filename: filename); +''', + ); }); test('unindents blocks and plaster', () async { - const String filename = 'main.dart'; - - const String before = ''' + await testInjection( + ''' Example: - + ```dart ``` -'''; - - const String source = ''' +''', + ''' // #docregion SomeSection A // #enddocregion SomeSection // #docregion SomeSection B // #enddocregion SomeSection -'''; - - const String after = ''' +''', + ''' Example: - + ```dart A // ··· B ``` -'''; - - await testInjection( - before: before, source: source, after: after, filename: filename); +''', + ); }); test('relative path bases', () async { @@ -485,78 +447,6 @@ FAIL ]), ); }); - - group('File type tests', () { - const List> testCases = >[ - {'filename': 'main.cc', 'language': 'c++'}, - {'filename': 'main.cpp', 'language': 'c++'}, - {'filename': 'main.dart'}, - {'filename': 'main.js'}, - {'filename': 'main.kt', 'language': 'kotlin'}, - {'filename': 'main.java'}, - {'filename': 'main.gradle', 'language': 'groovy'}, - {'filename': 'main.m', 'language': 'objectivec'}, - {'filename': 'main.swift'}, - { - 'filename': 'main.css', - 'prefix': '/* ', - 'suffix': ' */' - }, - { - 'filename': 'main.html', - 'prefix': '' - }, - { - 'filename': 'main.xml', - 'prefix': '' - }, - {'filename': 'main.yaml', 'prefix': '# '}, - {'filename': 'main.sh', 'prefix': '# '}, - {'filename': 'main', 'language': 'txt', 'prefix': ''}, - ]; - - void runTest(Map testCase) { - test('updates ${testCase['filename']} files', () async { - final String filename = testCase['filename']!; - final String language = testCase['language'] ?? filename.split('.')[1]; - final String prefix = testCase['prefix'] ?? '// '; - final String suffix = testCase['suffix'] ?? ''; - - final String before = ''' -Example: - - -```$language -X Y Z -``` -'''; - - final String source = ''' -FAIL -$prefix#docregion SomeSection$suffix -A B C -$prefix#enddocregion SomeSection$suffix -FAIL -'''; - - final String after = ''' -Example: - - -```$language -A B C -``` -'''; - - await testInjection( - before: before, source: source, after: after, filename: filename); - }); - } - - testCases.forEach(runTest); - }); } void main() { diff --git a/script/tool/test/update_min_sdk_command_test.dart b/script/tool/test/update_min_sdk_command_test.dart index 52d69ccb7bd0..8334ebb540b6 100644 --- a/script/tool/test/update_min_sdk_command_test.dart +++ b/script/tool/test/update_min_sdk_command_test.dart @@ -38,91 +38,98 @@ void main() { expect(commandError, isA()); }); - test('updates Dart when only Dart is present, with manual range', () async { + test('updates Dart when only Dart is present', () async { final RepositoryPackage package = createFakePackage( 'a_package', packagesDir, - dartConstraint: '>=3.0.0 <4.0.0'); + dartConstraint: '>=2.12.0 <4.0.0'); await runCapturingPrint(runner, [ 'update-min-sdk', '--flutter-min', - '3.13.0', // Corresponds to Dart 3.1.0 + '3.3.0', // Corresponds to Dart 2.18.0 ]); final String dartVersion = package.parsePubspec().environment?['sdk'].toString() ?? ''; - expect(dartVersion, '^3.1.0'); + expect(dartVersion, '>=2.18.0 <4.0.0'); }); - test('updates Dart when only Dart is present, with carrot', () async { - final RepositoryPackage package = - createFakePackage('a_package', packagesDir, dartConstraint: '^3.0.0'); + test('does not update Dart if it is already higher', () async { + final RepositoryPackage package = createFakePackage( + 'a_package', packagesDir, + dartConstraint: '>=2.19.0 <4.0.0'); await runCapturingPrint(runner, [ 'update-min-sdk', '--flutter-min', - '3.13.0', // Corresponds to Dart 3.1.0 + '3.3.0', // Corresponds to Dart 2.18.0 ]); final String dartVersion = package.parsePubspec().environment?['sdk'].toString() ?? ''; - expect(dartVersion, '^3.1.0'); + expect(dartVersion, '>=2.19.0 <4.0.0'); }); - test('does not update Dart if it is already higher', () async { - final RepositoryPackage package = - createFakePackage('a_package', packagesDir, dartConstraint: '^3.2.0'); + test('updates both Dart and Flutter when both are present', () async { + final RepositoryPackage package = createFakePackage( + 'a_package', packagesDir, + isFlutter: true, + dartConstraint: '>=2.12.0 <4.0.0', + flutterConstraint: '>=2.10.0'); await runCapturingPrint(runner, [ 'update-min-sdk', '--flutter-min', - '3.13.0', // Corresponds to Dart 3.1.0 + '3.3.0', // Corresponds to Dart 2.18.0 ]); final String dartVersion = package.parsePubspec().environment?['sdk'].toString() ?? ''; - expect(dartVersion, '^3.2.0'); + final String flutterVersion = + package.parsePubspec().environment?['flutter'].toString() ?? ''; + expect(dartVersion, '>=2.18.0 <4.0.0'); + expect(flutterVersion, '>=3.3.0'); }); - test('updates both Dart and Flutter when both are present', () async { + test('handles Flutter 3.10.0', () async { final RepositoryPackage package = createFakePackage( 'a_package', packagesDir, isFlutter: true, - dartConstraint: '>=3.0.0 <4.0.0', - flutterConstraint: '>=3.10.0'); + dartConstraint: '>=2.12.0 <4.0.0', + flutterConstraint: '>=2.10.0'); await runCapturingPrint(runner, [ 'update-min-sdk', '--flutter-min', - '3.13.0', // Corresponds to Dart 3.1.0 + '3.10.0', // Corresponds to Dart 3.0.0 ]); final String dartVersion = package.parsePubspec().environment?['sdk'].toString() ?? ''; final String flutterVersion = package.parsePubspec().environment?['flutter'].toString() ?? ''; - expect(dartVersion, '^3.1.0'); - expect(flutterVersion, '>=3.13.0'); + expect(dartVersion, '>=3.0.0 <4.0.0'); + expect(flutterVersion, '>=3.10.0'); }); test('does not update Flutter if it is already higher', () async { final RepositoryPackage package = createFakePackage( 'a_package', packagesDir, isFlutter: true, - dartConstraint: '^3.2.0', - flutterConstraint: '>=3.16.0'); + dartConstraint: '>=2.19.0 <4.0.0', + flutterConstraint: '>=3.7.0'); await runCapturingPrint(runner, [ 'update-min-sdk', '--flutter-min', - '3.13.0', // Corresponds to Dart 3.1.0 + '3.3.0', // Corresponds to Dart 2.18.0 ]); final String dartVersion = package.parsePubspec().environment?['sdk'].toString() ?? ''; final String flutterVersion = package.parsePubspec().environment?['flutter'].toString() ?? ''; - expect(dartVersion, '^3.2.0'); - expect(flutterVersion, '>=3.16.0'); + expect(dartVersion, '>=2.19.0 <4.0.0'); + expect(flutterVersion, '>=3.7.0'); }); }